【Django】Error - Django : Table doesn't exist

Posted by 西维蜀黍 on 2019-10-20, Last Modified on 2021-09-21

Problem

I dropped some table related to an app. and again tried this command

$ python manage.py syncdb

It shows error like

django.db.utils.ProgrammingError: (1146, "Table 'someapp.feed' doesn't exist")

Solution

  1. drop tables
  2. comment-out the model in model.py,
  3. if django version >= 1.7:
$ python manage.py makemigrations
$ python manage.py migrate --fake

​ else

$ python manage.py schemamigration someapp --auto
$ python manage.py migrate someapp --fake
  1. comment-in your model in models.py
  2. if django version >= 1.7:
$ python manage.py makemigrations
$ python manage.py migrate

​ else

$ python manage.py schemamigration someapp --auto
$ python manage.py migrate someapp

Reference