Hi All!
I caught a error when I move from Dajngo 1.7 to 1.8.
I wanted to add new model, for example:
class Test(models.Model):
class Meta():
db_table = 'test'
userID = models.ForeignKey(User)
minAge = models.PositiveSmallIntegerField(default=0)
maxAge = models.PositiveSmallIntegerField(default=150)
allowedGender = models.PositiveSmallIntegerField(default=0)
I created migration, it is normal. Then I tried to apply it by manage.py migrate but I caught an error "RuntimeError: Error creating new content types. Please make sure contenttypes is migrated before trying to migrate apps individually.".
Or if rise clear exception it will be "null value in column "name" violates not-null constraint"
This error is rised from django/contryb/contenttypes/models.py in get_for_model.
Then I observed that Django tried to get a field "name" in DB teble django_content_types. This field really exists there.
Thus, Django tried to get content type before it was creted.
I'd like to ask "Why???". Is it a bug?