intermittent migration error

39 views
Skip to first unread message

Ben Cail

unread,
Jan 25, 2022, 2:10:18 PM1/25/22
to django...@googlegroups.com
Hello,

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.

Should I open a Django issue, or is there something else going on here?

Thanks,

-Ben

Jason

unread,
Jan 26, 2022, 9:19:23 AM1/26/22
to Django users

nice find!  I would open a django issue, repeating what you have here, so Mariusz can see and triage.

Ben Cail

unread,
Jan 26, 2022, 9:54:12 AM1/26/22
to django...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/089e365d-b1a0-4d14-8440-2ac13f46e155n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages