Opened 6 years ago
Last modified 5 years ago
#31410 closed Cleanup/optimization
makemigrations doesn't check that UniqueConstraint field names exist — at Version 2
| Reported by: | Marnanel Thurman | Owned by: | nobody |
|---|---|---|---|
| Component: | Database layer (models, ORM) | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Ian Foote | Triage Stage: | Accepted |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | yes | UI/UX: | no |
Description (last modified by )
When a model gains a UniqueConstraint, makemigrations doesn't check that the fields named therein actually exist.
This is in contrast to the older unique_together syntax, which raises models.E012 if the fields don't exist.
In the attached demonstration, you'll need to uncomment "with_unique_together" in settings.py in order to show that unique_together raises E012.
Change History (3)
by , 6 years ago
| Attachment: | uniqueconstraint_bug.zip added |
|---|
comment:1 by , 6 years ago
| Component: | Uncategorized → Migrations |
|---|
comment:2 by , 6 years ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.
Demonstration