Django Migration Error: Column does not exist

后端 未结 15 2299
北恋
北恋 2020-12-10 10:25

Python 3, Django 1.8.5, Postgres

I have a model Sites that has been working fine. I recently tried to add a field, airport_code, and migrate the data.

15条回答
  •  旧巷少年郎
    2020-12-10 11:15

    Stuck into this issue recently.

    In my case, I added a reference to a non-existing field in the code, then I came to the model file and added the new field, then tried to run makemigrations command which thrown the above error.

    So I went to the stack trace all the way up and found the newly added reference was the problem. commented that out, ran makemigrations and voila.

提交回复
热议问题