#34357: UniqueConstraint doesn't violate NULL values on SQLite.
-------------------------------------+-------------------------------------
Reporter: Conrad | Owner: nobody
Type: Bug | Status: closed
Component: Database layer | Version: 4.1
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):
* status: new => closed
* resolution: => invalid
* component: Uncategorized => Database layer (models, ORM)
Comment:
Thanks for the report. `NULL` doesn't violate unique constraints or cause
conflicts in most (all?) databases, that's why it's possible to add
multiple `NULL`-values. This is a database behavior, not something that
Django is responsible for. I'm not sure Django documentation is the right
place to document this. Closing as "invalid" unless someone strongly
believes we should document this.
> but if I understand https://stackoverflow.com/questions/15497985/how-
to-add-unique-constraint-to-existing-table-in-sqlite correctly it is not
really the right way of adding the constraint.
This is the right way to add unique partial constraint on SQLite.
--
Ticket URL: <https://code.djangoproject.com/ticket/34357#comment:2>
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 view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/010701867237cb37-b0e29b02-706a-4dfc-bc58-b6f36e09bcb1-000000%40eu-central-1.amazonses.com.