How can I resolve 'django_content_type already exists'?

Dan O'Boyle :

After upgrading to django 1.8 I'm recieving the error during migration:

ProgrammingError: relation "django_content_type" already exists

I'd be interested in the background behind this error, but more importantly, How can I resolve it?

Dan O'Boyle :

Initial migrations on a project can sometimes be troubleshot using --fake-initial

python manage.py migrate --fake-initial

It's new in 1.8. In 1.7, --fake-initial was an implicit default, but explicit in 1.8.

From the Docs:

The --fake-initial option can be used to allow Django to skip an app’s initial migration if all database tables with the names of all models created by all CreateModel operations in that migration already exist. This option is intended for use when first running migrations against a database that preexisted the use of migrations. This option does not, however, check for matching database schema beyond matching table names and so is only safe to use if you are confident that your existing schema matches what is recorded in your initial migration.

https://docs.djangoproject.com/en/1.8/ref/django-admin/#django-admin-option---fake-initial

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I resolve 'django_content_type already exists'?

relation "django_content_type" already exists django

How can I get past this "'django_content_type' does not exist" error when deploying with Heroku?

How can I tell if I value already exists in Firebase Firestore?

How can i resolve an already running promise in my promise

How can I replace a file if already exists in the destination folder?

How I can check that unique data in pivot table already exists?

How can I check if append element already exists?

How can I check if an iptables rule already exists?

How can I add to the end of the string that already exists in input field?

How can I check whether the numpy array exists already or not?

How can I show an error message if a value already exists in the database?

How can I check whether an item already exists in state?

How can I check if the phone number already exists in the Firebase Authentication?

How can I check if username already exists in the file

How can I create a new user but with a home directory that already exists?

How can I display a message if a value already exists in database?

How can I create an Rc<RefCell<_>> to something that already exists?

How can I check if a printer already exists before attempting to add it?

How do I overwrite a file if it already exists?

How can I skip the label if the value label already exists on my state but the new value will be included?

How can I check if a value exists already in a Firebase data class Android

Android Room - How can I check if an entity with the same name already exists before inserting?

How can i check if a value exists already in a Parse data class Android

How can I specify that curl (via command line) overwrites a file if it already exists?

How can I get DynamoDbContext to throw an exception on Save if an item hash key already exists

R - How can I add an empty POSIXct column to a data.frame / tibble which already exists?

How can i do a join with a GEOJson file and a table that exists already in the database?

How can I check if a user already exists before calling smooch.appUsers.get?

TOP Ranking

HotTag

Archive