Django.db.utils.OperationalError: no such column: home_student.schoolYear
models.py '''
class Person(models.Model):
firstname = models.CharField(max_length=30)
lastname = models.CharField(max_length=30)
othernames = models.CharField(max_length=40)
dateOfBirth = models.DateField()
gender = models.CharField(max_length=20)
birthGender = models.CharField(max_length=20)
email = models.EmailField(max_length=100)
class Student(Person):
studentId = models.IntegerField()
admissionDate = models.DateField()
enrolmentStatus = models.BooleanField()
studentExamCode = models.IntegerField()
schoolYear = models.IntegerField()
'''
forms.py '''
class studentF(ModelForm):
class Meta:
model = Student
fields = ['firstname', 'lastname', 'othernames', 'dateOfBirth', 'gender', 'birthGender', 'email', 'studentId', 'admissionDate', 'enrolmentStatus', 'studentExamCode', 'schoolYear']
'''
I am getting the error in the title, how do I fix it?
make sure you have done what @raphael said you should do. if issue persist,
python manage.py makemigrations --merge
python manage.py migrate --fake