#31653: Add PostgreSQL operations to add constraints via NOT VALID / VALIDATE
CONSTRAINT
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |
Type: | Status: new
Cleanup/optimization |
Component: contrib.postgres | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Simon Charette):
* stage: Unreviewed => Accepted
Comment:
> I think custom django.contrib.postgres operations would be the way. They
can document to use non-atomic migrations. Rather than AddConstraint(...,
validate=False) I'd suggest AddConstraintNotValid(...) as a subclass of
AddConstraint, and ValidateConstraint.
I think that's the way to go as well. I'd suggest we document breaking the
operations in two migrations instead of using `atomic=False` otherwise
your database will be left in a inconsistent state if the
`ValidateConstraint` operation fails.
--
Ticket URL: <https://code.djangoproject.com/ticket/31653#comment:7>
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/068.1ceb0d9e42e33ea89980fe33eae92315%40djangoproject.com.