#29848: If using db_column in a model makemigrations is wrong
-------------------------------------+-------------------------------------
     Reporter:  Erik Bent            |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  2.1
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  migration            |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):

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


Comment:

 There is a difference between field and column renaming, it is expected
 that an `AddField` or `RenameField` is generated is this case depending on
 what's specified when prompted by the migration questioner during the
 `makemigrations` phase.

 Django migration track all model state changes even the ones that don't
 result in DDL (e.g. RENAME COLUMN). What should be considered a bug is if
 running the migration containing the `RenameField` crashed or if it
 generated any SQL at all as that could be optimized (e.g. using `migrate`
 and `sqlmigrate`). From my local testing that doesn't seem to be the case
 though.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29848#comment:1>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.2a90a03a3bc3010cfbeb1ecc83614082%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to