South: Migrations for Django

South: Migrations for Django

The very first public presentation of South, at the Schema Evolution panel at DjangoCon 2008. Video at https://www.youtube.com/watch?v=VSq8m00p1FM

077e9a0cb34fa3eba2699240c9509717?s=128

Andrew Godwin

September 07, 2008
Tweet

Transcript

  1. south migrations for django south.aeracode.org

  2. south migrations for django Why? 1. Migrations are essential. 2.

    Branched development/ missing migrations 3. Inter-app dependencies 4. Database abstraction needed too!
  3. south migrations for django syncdb dropdb syncdb time create initial

    models add new fields create create create syncdb create create create
  4. south migrations for django syncdb dropdb syncdb time create initial

    models add new fields create create create syncdb create create create south createmigration --initial migrate create create create write new migration migrate alter alter alter
  5. south migrations for django database independence class Migration: def forwards(self):

    # Model 'Category' db.create_table('aeblog_category', ( ('id', models.AutoField( verbose_name='ID', primary_key=True, auto_created=True, )), ('title', models.CharField(max_length=255)), ('slug', models.SlugField()) ))
  6. south migrations for django missing migrations 001_foo 002_bar 003_baz 004_phou

    001_foo 002_bar 003_baz 001_foo 002_bar 003_baz 004_phou 001_foo 002_bar 003_baz 004_fizz 001_foo 002_bar 003_baz 004_fizz 001_foo 002_bar 003_baz > > > > >
  7. south migrations for django missing migrations 004_phou 001_foo 002_bar 003_baz

    004_fizz 001_foo 002_bar 003_baz > 004_fizz 001_foo 002_bar 003_baz 004_phou > south: problem detected, --merge fixes it global number (e.g. rails): problem never found
  8. south migrations for django dependencies 001_forum 002_post 003_add_date have to

    migrate in correct order 004_pictures 001_initial 002_add_code 003_pictures
  9. south migrations for django dependencies 001_forum 002_post 003_add_date have to

    migrate in correct order 004_pictures 001_initial 002_add_code 003_pictures 1 2 3 4 5 6 7
  10. south migrations for django quick demo