2
votes

I've dropped my Postgres database by accident. Then as per this solution I deleted the migration files but now can't execute the third step's command "python manage.py migrate --fake".

RuntimeError: Error creating new content types. 
Please make sure contenttypes is migrated before trying to migrate apps individually.


psycopg2.ProgrammingError: relation "django_content_type" does not exist
LINE 1: ..."."app_label", "django_content_type"."model" FROM "django_co...
                                                         ^

I tried running "python manage.py migrate contenttypes" and "python manage.py makemigrations contenttypes --empty" but neither work.

Using django 1.9.5

1
You must run syncdb first ! - Mbambadev
@rakwouen: not on Django 1.9.5 they don't. syncdb is gone in 1.9, it's manage.py migrate replaces it. See "Unknown command syncdb" running "python manage.py syncdb" - Martijn Pieters♦

1 Answers

-1
votes

Synchronise your project first: like this:

python manage.py syncdb

when finish you can run: python manage.py makemigrations and last python manage.py migrate