How do you freeze an unfrozen model so that you can continue to use the South?

Using another user's code fork, I added a model field and performed the usual automatic migration:

~ $ django_admin.py migrate mezzanine_slides --auto You cannot use automatic detection, since the previous migration does not have this whole app frozen. Either make migrations using '--freeze mezzanine_slides' or set 'SOUTH_AUTO_FREEZE_APP = True' in your settings.py. 

I tried the obvious options using the hint to no avail and did not get anywhere from the documentation.

+7
django django-south
source share
1 answer

OK, with some trial and error: I created a โ€œfrozen migrationโ€ this way:

 ~ $ django_admin.py schemamigration --freeze mezzanine_slides mezzanine_slides freeze --empty Created 0002_freeze.py. You must now edit this migration and add the code for each direction. 

Then I edited the resulting migration and deleted the added field so that:

 ! $ django_admin.py schemamigration mezzanine_slides --auto + Added field caption on mezzanine_slides.Slide Created 0003_auto__add_field_slide_caption.py. You can now apply this migration with: ./manage.py migrate mezzanine_slides 

with this done, migration worked fine.

+8
source share

All Articles