#36645: PostgreSQL migration regression: `InternalError: cannot drop column id
of
table ... because other objects depend on it`
-------------------------------------------+------------------------------
Reporter: Adam Johnson | Owner: Adam Johnson
Type: Bug | Status: assigned
Component: Migrations | Version: 6.0
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------------
When testing a client project on Django 6.0, its migrations fail to run,
crashing with an exception like:
{{{
django.db.utils.InternalError: cannot drop column id of table library_book
because other objects depend on it
DETAIL: constraint ratings_rating_book_id_9d017958_fk_library_book_id on
table ratings_rating depends on column id of table library_book
HINT: Use DROP ... CASCADE to drop the dependent objects too.
}}}
The exact conditions:
1. PostgreSQL (tested on 15 and reproduced on 18)
2. A model that has been migrated from vanilla to use multi-table
inheritance
3. A model in another app that FK's to the first model, with its migration
dependency on the first models' first migration.
Reproducer repository incoming.
--
Ticket URL: <https://code.djangoproject.com/ticket/36645>
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 visit
https://groups.google.com/d/msgid/django-updates/01070199bf0af45d-389e2e37-84ca-4f13-b57f-30629afd5671-000000%40eu-central-1.amazonses.com.