Skip to content
nt3rp edited this page Nov 6, 2012 · 3 revisions

Documentation: http://south.readthedocs.org/en/latest/
Description: South is a django application for model data and schema migrations.
Usage:

  • Create the initial schema migration file (necessary if the model is new)

      python manage.py schemamigration appname --initial [migration name]
    
  • Apply schema migrations

      python manage.py migrate [appname]
    
  • Create a schema migration after a model has changed

      python manage.py schemamigration appname --auto [migration name]
    
  • Update the previous schema migration

      python manage.py schemamigration --auto --update [migration name]
    
  • Graph migrations (GraphViz must be installed)

      python manage.py graphmigrations | dot -Tpng -omigrations.png
    
  • Create a data migration (See the data migration tutorial)

      python manage.py datamigration appname datamigrationname
    

Clone this wiki locally