Django 1054 - Unknown column in field list
I have a Django project and I did the following:
- Added multi-column table
- Insert some entries into db
- Added a new column that I didn't understand what I needed
- Made update to populate this column
When I did migrate
, everything worked fine. A new db column has been created in the table and the values ββhave been populated.
However, when I try to run my tests, I now bomb in step 2 above. When I insert, I believe it expects this field to be, even though it hasn't been created yet at this point.
What should I do?
EDIT: additional information
First I created a class, class A and did a migration to create the table. Then I ran this against my db. Then I wrote a manual migration to fill in some data that I knew would be there. I am against dB. After a while, I realized that I needed an additional field on the model. I added this field and migrated and executed over the database. Everything worked fine and I confirmed that the new column is in the database.
Now I went for tests. It tried to create a test db and got bombarded saying "1054 - Unknown column [my new column that I added to an existing table]" while trying to run the populated data script I wrote. He's probably looking at the table, noticing that a third field exists in the model but is not yet in the database, but I don't know how to do it better.
source to share