0
I have 2 models:
class MdlCourse(models.Model):
id = models.BigAutoField(primary_key=True)
category = models.ForeignKey(MdlCourseCategories, on_delete=models.CASCADE)
sortorder = models.BigIntegerField()
fullname = models.CharField(max_length=254)
class MdlCourseCategories(models.Model):
id = models.BigAutoField(primary_key=True)
name = models.CharField(max_length=255)
When I spin it gives the following error:
(1054, "Unknown column 'mdl_course.category_id' in 'field list'")
What I’m doing wrong?
You ran the migrate command to synchronize the database ? PS: It is not necessary to create the id field, it is created automagically... :)
– André Roggeri Campos