Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Migrations: Whatwhyhowwho?

Migrations: Whatwhyhowwho?

A talk I gave at EuroDjangoCon 2009.

Andrew Godwin

May 04, 2009
Tweet

More Decks by Andrew Godwin

Other Decks in Programming

Transcript

  1. Migrations:
    whatwhyhowwho?
    http://www.flickr.com/photos/moonjazz/1216783552/

    View full-size slide

  2. I'm�Andrew.
    @andrewgodwin
    http://aeracode.org

    View full-size slide

  3. mi·gra·tion
    whatwhyhowwho?
    1.�noun
    A�way�to�keep�your�sanity�when
    changing�model�definitions.
    See�also:�Schema�Evolution

    View full-size slide

  4. whatwhyhowwho?
    class Pony(models.Model ):
    name = models.CharField(max_length=100)
    height = models.IntegerField()
    class Pony(models.Model ):
    name = models.CharField(max_length=100)
    height = models.FloatField()
    born = models.DateField()

    View full-size slide

  5. whatwhyhowwho?
    django.contrib.migrations

    View full-size slide

  6. whatwhyhowwho?
    south
    migratory
    yadsel
    django-evolution
    dmigrations
    deseb
    schema-evolution

    View full-size slide

  7. whatwhyhowwho?
    south
    migratory
    yadsel
    django-evolution
    dmigrations
    deseb
    schema-evolution

    View full-size slide

  8. whatwhyhowwho?
    django-evolution
    ·�1½�years�old
    ·�uses�syncdb�initially
    ·�support�automatic�'hinting'

    View full-size slide

  9. whatwhyhowwho?
    dmigrations
    ·�8�months�old
    ·�uses�migrations�from�start
    ·�MySQL�only
    ·�migrations�are�project-wide

    View full-size slide

  10. whatwhyhowwho?
    south
    ·�8�months�old
    ·�uses�migrations�from�start
    ·�supports�'autodetection'
    ·�migrations�are�per-app
    ·�mine

    View full-size slide

  11. whatwhyhowwho?
    south
    django-evolution
    vs

    View full-size slide

  12. whatwhyhowwho?
    why?
    why?

    View full-size slide

  13. whatwhyhowwho?
    south django-evolution
    1.�install
    3.�make�initial
    �����migration
    4.�migrate�to�initial
    2.�syncdb
    1.�install
    2.�syncdb

    View full-size slide

  14. whatwhyhowwho?
    south django-evolution
    1.�install
    3.�make�initial
    �����migration
    4.�migrate�to�initial
    2.�syncdb
    1.�install
    2.�syncdb

    View full-size slide

  15. whatwhyhowwho?
    live�demo
    Ponies!
    South!
    django-evolution!

    View full-size slide

  16. whatwhyhowwho?
    the
    f�u�t�u�r�e

    View full-size slide

  17. whatwhyhowwho?
    http://code.djangoproject.com/wiki/SchemaEvolution
    http://south.aeracode.org
    http://code.google.com/p/django-evolution/

    View full-size slide

  18. whatwhyhowwho?
    Thanks.
    Andrew�Godwin
    http://aeracode.org
    @andrewgodwin

    View full-size slide