I have been working on a Django (version 1.7.6) project for various months. Throughout this time each application evolved a good deal and there now various dozens of migrations.
I would like to deploy this project into a new development environment. I set up a database with an empty schema and updated settings.py
accordingly. Now I would like to recreate the database structure from the migrations, however I get the following exception when I run python manage.py migrate
:
File "/usr/lib/python2.7/dist-packages/django/db/backends/utils.py", line 65, in execute return self.cursor.execute(sql, params) django.db.utils.ProgrammingError: table "modules_server_proj_locations" does not exist
modules_server_proj_locations
refers to a many-to-many relationship that no longer exists, but for some reason the migrations are still trying use it.
I then tried to migrate with the --fake
option, but this only results in a different exception:
File "/usr/lib/python2.7/dist-packages/django/contrib/contenttypes/models.py", line 58, in get_for_model " is migrated before trying to migrate apps individually." RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.
How should I proceed?