After updating posts model field in MySQL database using using Django framework, I'm unable to query posts from the Database. Whenever I run the command python manage.py runserver, all seems to be well with the server. However, when enter the post url to display the list of posts I uploaded on the database before updating the model field, I get 1054, "Uknown column 'start_post.author_id' in the 'field list'
I have spent a couple of hours try to figure out why I'm getting the error but I still don't get it.
In model.py I had:
....
title = models.CharField()
preamble= models.Charfield()
body = models.TextField()
....
I updated the above model to:
....
title = models.CharField()
author = models.ForeignKey(User, on_delete=models.CASCADE)
introduction = models.charfield()
body = models.TextField()
....
Before updating it everything was working appropriately. But after updating it I'm unable to access the list of posts on browser, from the url start\ as well as the post detail page. I didn't have the author field in the first model but I added it to the updated model. What can I do to solve this problem?