Expand description
Constraint-level diffing inside an AlterTable.
Pairs constraints by QualifiedName. v0.1 emits only AddConstraint,
DropConstraint, and SetConstraintComment: any change to the definition
of an existing constraint is expressed as a drop-then-add pair, since
Postgres does not support most ALTER ... CONSTRAINT operations.
§Destructiveness
AddConstraint(...):Safe. The rewrite pass converts FK adds toNOT VALID + VALIDATEfor online behavior.DropConstraint: conservativelyRequiresApprovalfor every kind. We may relax CHECK / UNIQUE drops toSafein a future pass once we have experience with users.SetConstraintComment:Safe.
Functions§
- diff_
constraints - Diff constraints in
targetagainstsource, appending entries toout.