Hi, Please don't cross post to django-users and django-developers. This mailing list is for the development of Django itself. I'll answer your question on django-users. Thanks!
On Monday, June 29, 2015 at 5:05:41 AM UTC-4, ClosiusBeg wrote: > > 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. > But then I saw the migration 0002_remove_content_type_name.py there > https://github.com/django/django/tree/master/django/contrib/contenttypes/migrations > > Thus, Django tried to get content type before it was creted. > > I'd like to ask "Why???". Is it a bug? > > PS: Sorry if I dublicate this post. I'm a newbie here. > -- You received this message because you are subscribed to the Google Groups "Django developers (Contributions to Django itself)" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/django-developers. To view this discussion on the web visit https://groups.google.com/d/msgid/django-developers/d0fa3624-5eeb-4350-92c8-1a0ced8618c7%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
