#33462: intermittent migration error
--------------------------------------+------------------------
               Reporter:  bcail       |          Owner:  nobody
                   Type:  Bug         |         Status:  new
              Component:  Migrations  |        Version:  dev
               Severity:  Normal      |       Keywords:
           Triage Stage:  Unreviewed  |      Has patch:  0
    Needs documentation:  0           |    Needs tests:  0
Patch needs improvement:  0           |  Easy pickings:  0
                  UI/UX:  0           |
--------------------------------------+------------------------
 I ran into an intermittent migration issue on Django 4.x and PostgreSQL.
 The migrations work fine on Django 3.2.x, but intermittently fail on
 Django 4.x with the following exception:

 django.db.utils.ProgrammingError: constraint
 "polls_questioncontribution_base_question_id_25bfb2a8_fk" for relation
 "polls_questioncontribution" already exists

 I made a small demo repo to show the problem:
 https://github.com/bcail/migration_error. I put the sqlmigrate output
 from Django 3.2 and Django 4 in the repo, and it looks like Django 4
 (sometimes) creates duplicate SQL statements.

 I also ran git bisect on the Django code, and it looks like the problem
 starts showing up with this commit:
 
https://github.com/django/django/commit/3d9040a50b160f8b4bb580e09f4120d4979fe29e.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33462>
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/048.e4aecbcb317e8446c1b59746d87397ab%40djangoproject.com.

Reply via email to