Add support for EXCLUDE USING constraint
A lot of work was done to add the check constraint to Django 2.2. On top of such a constraint, PostgreSQL has an exclusion constraint that works well on ranges, regardless if they're represented using two fields, or a single field using a range-type. Essentially, this constraint enforces a unique constraint for ranges, with a possibility for an additional check.
https://github.com/tbicr/django-pg-zero-downtime-migrations/ uses ALTER TABLE %(table)s VALIDATE CONSTRAINT to restrict how long the table is locked for writing. I was contemplating to touch this subject in the patch.
PR
Change History
(9)
| Description: |
modified (diff)
|
| Patch needs improvement: |
set
|
| Triage Stage: |
Unreviewed → Accepted
|
| Version: |
2.1 → master
|
| Summary: |
Exclude using constraint → Add support for EXCLUDE USING constraint
|
| Patch needs improvement: |
unset
|
| Patch needs improvement: |
set
|
| Patch needs improvement: |
unset
|
| Triage Stage: |
Accepted → Ready for checkin
|
| Resolution: |
→ fixed
|
| Status: |
assigned → closed
|
I believe the PR is now in a state where it merits a review. I'm not sure if the tests should also include the model with two fields, or if it's sufficient that it's discussed in the documentation.