#33057: DROP of foreign key constraints in through model when related models
migrate to BigAutoField pk
---------------------------------------------+------------------------
Reporter: Fabio Sangiovanni | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 3.2
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 |
---------------------------------------------+------------------------
Hi,
I'm experiencing a weird behaviour migrating from Django 3.1.13 to 3.2.6.
With the following setup:
- Python 3.8.10
- PostgreSQL 11.12
- custom user model with `AutoField` pk
- model (also with `AutoField` pk) related to `User` via `ManyToManyField`
upgrading to Django 3.2.6 with `DEFAULT_AUTO_FIELD =
'django.db.models.BigAutoField'` leads to a DROP of the foreign key
constraints on the (implicit) through model.
The field types on the through model referencing the related models get
upgraded correctly; only FK constraints go missing.
I've setup a small reproducer at https://github.com/sanjioh/django32fk
Interested tables: `app_pet_owner` and Django owned ones involving the
`User` model (`app_user_groups` and `app_user_user_permissions`).
Please let me know if I can be of further help.
Fabio
--
Ticket URL: <https://code.djangoproject.com/ticket/33057>
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/050.ebe5356f8f02965154dd70b8bf1f72ba%40djangoproject.com.