[Django]-Django South – Creating initial migration for an app that has already populated tables

12👍

This is covered in the manual.

Converting an app to use South is very easy:

  • Edit your settings.py and put ‘south’ into INSTALLED_APPS (assuming you’ve installed it to the right place)
  • Run ./manage.py syncdb to load the South table into the database. Note that syncdb looks different now – South modifies it.
  • Run ./manage.py convert_to_south myapp – South will automatically make and pretend to apply your first migration.

Note that you’ll need to convert before you make any changes; South detects changes by comparing against the frozen state of the last migration, so it cannot detect changes from before you converted to using South.

👤and3p

Leave a comment