0

What if I used an app that didn't use South migration in let's say version 0.4 and wanted to upgrade it to the latest version of let's say 0.6 which has included a migration directory that has 0001_initial and 0002_some_new_fields_added.

How would you got about that in production environment?

Assumption: The Django project didn't rely on South before!

Is the following the right way as per South's tutorial?

  1. stay on the old version of the app for now
  2. include South in the INSTALLED_APPS
  3. run schemamigration theAPP --fake
  4. upgrade the app
  5. run schemamigration OtherApps --fake (optional)
  6. run migration theAPP --all

Done?

I did this, the migration was invoked on the app, however, "no migration found" was displayed. I verified that the migration directory and items were present.

What step did I miss?

Disclaimer: The App is my own (http://github.com/un33k/django-emailmgr) and initially I didn't release it with migration built-in, then in version 0.5 I included initial and changes in the migration directory. But things didn't go smooth when I tried to upgrade the app within my own Django project. So, I ended up to do things manually.

Val Neekman
  • 17,692
  • 14
  • 63
  • 66
  • When you started using south on the app, did you first run: manage.py convert_to_south [app_name] ? – Brandon Taylor Dec 07 '11 at 20:33
  • nope! could that be it? I was under the impression that step 3. from the above list kind of took care of that. – Val Neekman Dec 07 '11 at 20:45
  • Hmm. Running fake *is* supposed to be a step in the process of manually converting an app according to the docs. Honestly, I've never tried converting an app that way, I've always used 'convert_to_south' on an existing app. – Brandon Taylor Dec 07 '11 at 20:53
  • Get a copy of your 0.4 version. Convert it to south. Then overwrite your models.py with the 0.5 version and run schemamigration. Now you should have a copy of the migrations necessary from 0.4 to 0.5. Now go and replace your migrations in 0.5. Wouldn't that do the trick? – benjaoming Dec 07 '11 at 22:24
  • benjaoming: The app on its own has included the migration files. However the initial migration file was created on version 0.5. The 2nd migration file created with version 0.6. The app has no problem on its own. My Django project that includes the app started using the app at version 0.4, but now that it wants to go to version 0.6, I need to created the new columns, hence the use of the migration file. Here the app is my own, what if the app was 3rdparty? I don't want to change the apps models.py? I should just use its migration files. I want to use south to pull in the apps migration file. – Val Neekman Dec 07 '11 at 23:09
  • When we had a similar issue, ./manage.py convert_to_south took care of the issue. – karthikr Sep 05 '12 at 02:54

0 Answers0