Using django 1.7.5, I made changes to User_Profile by adding a field:
school = models.CharField(max_length = 255, blank=True, default="")
Then,
$ python manage.py makemigrations
No problem. It added the field. Next,
$ python manage.py migrate
gives me:
django.db.utils.IntegrityError: mathbreakers_userprofile__new.school may not be NULL
Uh oh. Well, after trying different things by making the field default=""
or blank=True
, nothing works. Forget it, I deleted the field and reverted the model to the way it was when everything worked fine. Model looks like it did before, and I run makemigrations, it removes the field (it says). Great!
However,
$ python manage.py migrate
still results in the SAME error, complaining about the field I added and then deleted. It's as if I can't make django forget that that field exists. But it doesn't exist in my models.py file. How do I fix this? Where is that field? Is it in my SqlLite that I should go in and delete it manually from there?
NOTE: I have manually deleted broken migration files and also reverted to a previous GIT version before the changes. Nothing has worked, python manage.py migrate
seems to still be broken..