Search code examples
djangodjango-modelsdjango-southdjango-syncdb

How to do a syncdb with django, when migrations are also involved


when I do a syncdb I get the following error everytime:

Not synced (use migrations):
 - deals
 - analytics
(use ./manage.py migrate to migrate these)

And when I run sudo python manage.py migrate. I get the following

Running migrations for deals:
- Nothing to migrate.
 - Loading initial data for deals.
No fixtures found.
Running migrations for analytics:
- Nothing to migrate.
 - Loading initial data for analytics.
No fixtures found.

I highly appreciate your help


Solution

  • From the output, it seems like the database is already synchronized with the migrations. There are no problematic errors. (Although you shouldn't really be root to run the migrations.)

    If you're looking into creating more migrations, use the south documentation, which usually is just running the following after you modify the models:

    python manage.py schemamigration --auto <APP>
    

    And then use python manage.py migrate to apply the changes.