Django Programming error column does not exist even after running migrations

前端 未结 9 1042
南旧
南旧 2020-12-08 20:54

I run python manage.py makemigrations and I get: No changes detected Then, python manage.py migrate and I get: No migrations to apply.

9条回答
  •  半阙折子戏
    2020-12-08 21:28

    Django migrations are recorded in your database under the 'django_migrations' table. This is how Django knows which migrations have been applied and which still need to be applied.

    Have a look at django_migrations table in your DB. It may be that something went wrong when your migration was applied. So, delete the row in the table which has the migration file name that is related to that column that 'does not exist'. Then, try to re-run a migration.

提交回复
热议问题