[Django] #36814: During migration for rename m2m field, alter table rename query not generated

0 views
Skip to first unread message

Django

unread,
7:59 AM (4 hours ago) 7:59 AM
to django-...@googlegroups.com
#36814: During migration for rename m2m field, alter table rename query not
generated
-------------------------------------+-------------------------------------
Reporter: Dan Tyan | Type: Bug
Status: new | Component:
| Migrations
Version: 6.0 | Severity: Normal
Keywords: migration, | Triage Stage:
manytomany | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Have one migration file
with rule:

{{{
migrations.RenameField(
model_name="order",
old_name="tags",
new_name="old_tags",
),
}}}

where tags is a ManyToMnay field

Django < 6 sqlmigrate generates next sql

{{{
--
-- Rename field tags on order to old_tags
--
ALTER TABLE "order_tags" RENAME TO "order_old_tags";
--
-- Raw SQL operation
--
}}}

Django 6 generates


{{{
--
-- Rename field tags on order to old_tags
--
-- (no-op)
--
-- Raw SQL operation
--

}}}

so django test fails with
--
Ticket URL: <https://code.djangoproject.com/ticket/36814>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
8:41 AM (3 hours ago) 8:41 AM
to django-...@googlegroups.com
#36814: During migration for rename m2m field, alter table rename query not
generated
-------------------------------------+-------------------------------------
Reporter: Dan Tyan | Owner: (none)
Type: Bug | Status: closed
Component: Migrations | Version: 6.0
Severity: Normal | Resolution: duplicate
Keywords: migration, | Triage Stage:
manytomany | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

* resolution: => duplicate
* status: new => closed

Comment:

Thanks for the report. Duplicate of #36800, fix shipping in Django 6.0.1.
--
Ticket URL: <https://code.djangoproject.com/ticket/36814#comment:1>
Reply all
Reply to author
Forward
0 new messages