Opened 4 years ago
Last modified 4 years ago
#31826 closed Cleanup/optimization
AlterField with only db_column changed should be a noop — at Version 3
Reported by: | Iuri de Silvio | Owned by: | Iuri de Silvio |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Simon Charette | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
When I change: pink = models.Integer(default=0)
to pink = models.Integer(default=0, db_column="pink")
the migration recreate constraints if it is an FK or even reconstruct the table (SQLite), but nothing really changed.
The (same) constraint drop/create is a blocking operation for PostgreSQL, so it is an undesirable and unexpected behavior.
Change History (3)
comment:2 by , 4 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 4 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.
I sent a PR here. https://github.com/django/django/pull/13237