-
Notifications
You must be signed in to change notification settings - Fork 106
Closed
Description
Constraints (initially CHECK
and FOREIGN KEY
) should be represented in pg-roll
's internal schema representation.
Also, UNIQUE
constraints should be part of the internal schema representation too.
Having constraints represented in the internal schema would enable:
- Better validation of operations involving constraints:
- Ensure that a constraint of the same name does not exist when adding a new constraint.
- Ensure that the constraint exists when dropping a constraint.
- Not having to specify the name of the column on which the constraint is defined when dropping a constraint (and the confusion that occurs when the wrong column is specified)
### Tasks
- [x] Validate constraint exists before dropping (https://github.com/xataio/pgroll/pull/252)
- [x] Ensure constraint of same name doesn't exist when adding an `FK` constraint
- [x] Ensure constraint of same name doesn't exist when adding a `CHECK` constraint
- [x] Ensure constraint of same name doesn't exist when adding a `UNIQUE` constraint
- [x] BREAKING CHANGE: no longer require `Column` field when dropping a constraint
Metadata
Metadata
Assignees
Labels
No labels