Django migrations : relation already exists

前端 未结 6 912
南笙
南笙 2021-02-06 18:46

I have trouble with django model migrations. I have some models in my app, and I already have some data inside. When I added some models in my application, and I run mak

6条回答
  •  误落风尘
    2021-02-06 19:21

    check your db tables to make sure you are not trying to recreate the table during migrations. that's what it was for me. If you have data in the table that you don't want to delete, remove all migrations from the app_name/migrations folder and then run ./manage.py migrate app_name --fake default

    then try makemigrations and migrate for the rest

提交回复
热议问题