0

I've dropped all tables from my postgres db. Now, while running

python manage.py syncdb

I'm getting error that abc fields doesn't exist in xyz table. It's probably some sort of django cache issue. Error is of this format:

django.db.utils.ProgrammingError: relation "mmb_data_genre" does not exist
LINE 1: ...b_data_genre"."id", "mmb_data_genre"."genre" FROM "mmb_data_...

Any suggestions how to fix this?

Note - I'm using django 1.8.2 and

python manage.py makemigratons

or

python manage.py runserver

is throwing same error.

randomuser
  • 1,201
  • 2
  • 10
  • 19

1 Answers1

1

syncdb in django 1.8 is merely an alias for the migrate command but with the additional step of creating a superuser.

Deprecated since version 1.7: This command has been deprecated in favor of the migrate command, which performs both the old behavior as well as executing migrations.

But syncdb (migrate) should be executed only after you have done makemigrations [app_label] but in your case you seem to have the order in reverse.

Try

./manage.py makemigrations
./manage.py migrate
e4c5
  • 52,766
  • 11
  • 101
  • 134