Opened 4 years ago
Last modified 4 years ago
#31826 closed Cleanup/optimization
AlterField with only db_column changed should be a noop — at Initial Version
Reported by: | Iuri de Silvio | Owned by: | nobody |
---|---|---|---|
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
When I change: pink = models.Integer(default=0)
to pink = models.Integer(default=0, db_column="pink")
the migration can recreate constraints if it is an FK or even reconstruct the table (SQLite).
The (same) constraint drop/create is a blocking operation for PostgreSQL, so it is an undesirable and unexpected behavior.
Note:
See TracTickets
for help on using tickets.