Django Model not accepting field

Viewed 84

I created the following Model:

Everything worked fine, until I decided to add these two fields:

Metric_name_dv = models.CharField(_('Metric name dv'), max_length=200)
Defect_Area_Investigator_dv =  models.CharField(_('Defect Area Investigator'), max_length=200)

After adding these two fields and running makemigrations and migrate i kept on getting this error:

When looking at sqlite3, i dont see the fields: Metric_name_dv & Defect_Area_Investigator_dv:

What could I be missing? I tried to clear all past migrations and that didnt work, so i reset it back to normal.

Here is the views.py:

2 Answers

Try delete the file db.sqlite3 and then run the commands python manage.py makemigrations, python manage.py migrate

You might need to add a blank=true attribute or default value to the new columns. This could be a source of error.

Related