#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.