1
votes

I'm trying to reset my south migration history and can't get migrations to run for myapp. My settings.py is:

...
'south',
'myapp',
'allauth',
'allauth.account',
'allauth.socialaccount',
'allauth.socialaccount.providers.facebook',
'payments',

What I've tried that unfortunately isn't working for me:

  1. Delete/rm all existing migration files
  2. Comment out everything except for south
  3. Run an initial syncdb
  4. Run ./manage.py schemamigration app_name --initial for each app
  5. Then migrate apps one by one

This process works fine for everything except myapp. When I try to do the initial migration for myapp I get:

hostMigrations: 
! These migrations are in the database but not on disk:
<myapp: 0002_..._>
! I'm not trusting myself; either fix this yourself by fiddling
! with the south_migrationhistory table, or pass --delete-ghost-migrations
! to South to have it delete ALL of these records (this may not be good).

If I pass --delete-ghost-migrations then it tells me there's nothing to migrate for myapp, which obviously isn't the case. When I --fake 0002 it tells me there's nothing else to migrate after 0002. Is there another way to approach this?

1

1 Answers

3
votes

To completely remove your migration history you need to delete every row in it's table on the database.

Go to your database and erase all rows in south_migrationhistory table:

delete from south_migrationhistory;

or if you want to just reset the history of a specific app you can do:

delete from south_migrationhistory where app_name='your_app_name';

Hope this helps!