Opened 11 years ago
Closed 11 years ago
#23570 closed Bug (invalid)
Schema editor drops DEFAULT from columns for backends that do support it
| Reported by: | Apostolis Bessas | Owned by: | Apostolis Bessas |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
The schema editor makes a check after a SET DEFAULT is issued for a column: it seems it wants to check, if the backend does not support DEFAULTs for a column with skip_default and drop it, if so.
However, the logic is inverted.
Change History (3)
comment:1 by , 11 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:2 by , 11 years ago
comment:3 by , 11 years ago
| Resolution: | → invalid |
|---|---|
| Status: | assigned → closed |
The idea is that Django shouldn't leave DEFAULT values in the database (see #23043). A default is only used in the ADD COLUMN SQL so that a field can be added as non-null.
Note:
See TracTickets
for help on using tickets.
Fix in https://github.com/django/django/pull/3292