schemainspect
schemainspect copied to clipboard
Add support for exclusion constraints
This should fix djrobstep/migra#147
Unfortunately this required some special casing of exclusion constraints in the SQL generation functions.
Exclusion constraints don't show up in information_schema.table_constraints
,
so remove that table from the constraints query, and use the equivalent fields
from pg_constraint
directly.
Also, the "USING INDEX" form is not available when creating an exclusion constraint. The index is always created implicitly. Instead of a "CREATE INDEX" statement, emit a dummy statement ("select 1;") for indexes that belong to exclusion constraints.
Awesome, thanks so much for contributing this! Have given it a brief lookover and all looks good, can hopefully give it a more detailed review later today and then merge.
This code, with some minor mods, is now added. Thanks so much for contributing this!