#26114: Removing Meta.db_table generates migration with wrong rename in comment
(None)
----------------------------+------------------------------------
     Reporter:  dvinegla    |                    Owner:  PREM1980
         Type:  Bug         |                   Status:  assigned
    Component:  Migrations  |                  Version:  1.9
     Severity:  Normal      |               Resolution:
     Keywords:              |             Triage Stage:  Accepted
    Has patch:  0           |      Needs documentation:  0
  Needs tests:  0           |  Patch needs improvement:  0
Easy pickings:  0           |                    UI/UX:  0
----------------------------+------------------------------------

Comment (by PREM1980):

 I'm thinking the following, please review and provide your comments.


 When someone provides "None" as the new table name, we won't detect that
 as a change and just ignore it.

 
https://github.com/django/django/blob/fb4272f0e6bbdaa3e19ed5fde59fdb5ab5a33baf/django/db/migrations/autodetector.py#L962

 This is the new change that works.

 if old_db_table_name != new_db_table_name and new_db_table_name != None:
                 self.add_operation(
                     app_label,
                     operations.AlterModelTable(
                         name=model_name,
                         table=new_db_table_name,
                     )
                 )

--
Ticket URL: <https://code.djangoproject.com/ticket/26114#comment:3>
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 django-updates+unsubscr...@googlegroups.com.
To post to this group, send email to django-updates@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.e45705355e92f20f57db2a1ac08bb789%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to