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

-- 
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/0107019b3bd7e545-f1471548-68f5-4b3b-95f0-b8fac3b2b090-000000%40eu-central-1.amazonses.com.

Reply via email to