whenever I update the model I get "No such column" error
bitFez opened this issue · 3 comments
bitFez commented
I cant seem to update the model without getting an error when trying to makemigrations / migrate that states the field I am trying to add does not exist in the table.
For example:
models:
maintenance_mode = models.BooleanField(default=False)
name = models.CharField(max_length=255, default='Open Mosque Project')
about = models.TextField(max_length=2000, blank=True) ## new field i've added ##
view:
from config.models import CentreProfile
centre = CentreProfile.objects.get()
##### Variables loaded from centre profile here #####
centre_name = centre.name
Error when I try to make migrations
django.db.utils.OperationalError: no such column: config_centreprofile.about
bitFez commented
It seems like the only way I can make an update to the model is to delete the database and all references to the model in all views where the model is being queried.
Is there a way to avoid having to do this?