0

I am upgrading my app from Django1.7->Django1.8, but I can't make any changes or even run migrations because I keep seeing the following system error whenever I attempt to perform any migration operation in the 1.8 environment

ERRORS:
content.Content.polymorphic_ctype: (fields.E306) The name 'polymorphic_content.content_set' is invalid related_name for field Content.polymorphic_ctype
    HINT: Related name must be a valid Python identifier or end with a '+'
content.Tag.polymorphic_ctype: (fields.E306) The name            'polymorphic_content.tag_set' is invalid related_name for field Tag.polymorphic_ctype
    HINT: Related name must be a valid Python identifier or end with a '+'
promotion.PZoneOperation.polymorphic_ctype: (fields.E306) The name 'polymorphic_promotion.pzoneoperation_set' is invalid related_name for field     PZoneOperation.polymorphic_ctype
    HINT: Related name must be a valid Python identifier or end with a '+'
reviews.MediaItem.polymorphic_ctype: (fields.E306) The name    'polymorphic_reviews.mediaitem_set' is invalid related_name for field   MediaItem.polymorphic_ctype
    HINT: Related name must be a valid Python identifier or end with a '+'

The problem is that 3 of those apps are part of a dependency and have already updated the related_name of the 3 fields to end with + in the 0001_initial.py migration, but I can't revert backwards due to the system errors. Kind of at loss with how to proceed with updating.

2 Answers2

1

Try deleting and re-generating your migrations with manage.py makemigrations <appname> for each app.

David G
  • 318
  • 2
  • 8
0

I had troubles with migrations after upgrading too. If wiping your whole DB and repopulating it from a scratch is an option, try this (after cleaning the DB): 1) run ./manage.py makemigrations app_name for each app 2) run ./manage.py migrate 3) run ./manage.py syncdb

Alexander
  • 631
  • 1
  • 8
  • 19