Opened 12 hours ago

Closed 11 hours ago

#36814 closed Bug (duplicate)

During migration for rename m2m field, alter table rename query not generated

Reported by: Dan Tyan Owned by:
Component: Migrations Version: 6.0
Severity: Normal Keywords: migration, manytomany
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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

Change History (1)

comment:1 by Jacob Walls, 11 hours ago

Resolution: duplicate
Status: newclosed

Thanks for the report. Duplicate of #36800, fix shipping in Django 6.0.1.

Note: See TracTickets for help on using tickets.
Back to Top