Search code examples
djangopostgresqlmigrationdjango-south

CircularDependency on south


I have an app with an initial migration that has a foreign-key pointing to second app wich doesn't have south migration. Now i'm trying to add migrations to the second app, but i'm facing Circular Dependency errors.

I was able to migrate my production database, but i'm having trouble with syncdb --migrate on my database.

That's i have tried:

./manage.py convert_to_south app2

./manage.py app2 --auto

I want to restore my database after this and when I will try again

./manage.py syncdb --migrate 

it doesn't work.


Solution

  • Run this command first:

    python manage.py schemamigration app_name --auto
    

    Then:

    python manage.py migrate
    

    Because you have already an existing migration for that you must delete the files and run something --delete--ghost--fake (I forgot the exact command) to delete the existing one.