#26149: Invalid migration generated when using order_with_respect_to and a unique_together constraint ----------------------------+------------------------------------ Reporter: richardxia | Owner: nobody Type: Bug | Status: new Component: Migrations | Version: 1.9 Severity: Normal | Resolution: Keywords: | Triage Stage: Accepted Has patch: 0 | Needs documentation: 0 Needs tests: 0 | Patch needs improvement: 0 Easy pickings: 0 | UI/UX: 0 ----------------------------+------------------------------------
Comment (by anabelensc): Hello, Could you check this patch, please? I changed "db/migrations/autodetector.py" and now there is no bug. python manage.py makemigrations Migrations for 'p1': p1/migrations/0001_initial.py: Create model Bar Create model Foo Set order_with_respect_to on foo to bar Alter unique_together for foo (1 constraint(s)) python manage.py migrate Operations to perform: Apply all migrations: admin, auth, contenttypes, p1, sessions Running migrations: Rendering model states... DONE Applying contenttypes.0001_initial... OK Applying auth.0001_initial... OK Applying admin.0001_initial... OK Applying admin.0002_logentry_remove_auto_add... OK Applying contenttypes.0002_remove_content_type_name... OK Applying auth.0002_alter_permission_name_max_length... OK Applying auth.0003_alter_user_email_max_length... OK Applying auth.0004_alter_user_username_opts... OK Applying auth.0005_alter_user_last_login_null... OK Applying auth.0006_require_contenttypes_0002... OK Applying auth.0007_alter_validators_add_error_messages... OK Applying auth.0008_alter_user_username_max_length... OK Applying p1.0001_initial... OK Applying sessions.0001_initial... OK Thanks -- Ticket URL: <https://code.djangoproject.com/ticket/26149#comment:2> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.f3c50575d87fe7a4e8068d2a7c19045e%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.