#29848: If using db_column in a model makemigrations is wrong
-------------------------------------+-------------------------------------
Reporter: erikbent | Owner: nobody
Type: Bug | Status: new
Component: Database | Version: 2.1
layer (models, ORM) |
Severity: Normal | Keywords: migration
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I have the following line in a model:
examplefield = models.CharField(db_column='ExampleField',
max_length=75)
I changed the line into:
example_field = models.CharField(db_column='ExampleField',
max_length=75)
If I run makemigrations the following is asked:
Did you rename boek.examplefield to boek.example_field (a CharField)?
[y/N]
If I answer N there is an add column recorded in the migration file.
If I answer Y there is a rename from examplefield to example_field
recorded in the migration file.
Both are wrong because there is an db_column in the CharField. The
expected behavior is that the fIeld is not changed.
--
Ticket URL: <https://code.djangoproject.com/ticket/29848>
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/051.ffac17bf09e3dbd96ee7d9c6da8a52a5%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.