migra
migra copied to clipboard
Exclusion constraint missing from diff
When adding a table using an exclusion constraint, for example:
CREATE EXTENSION btree_gist;
create table event(
resource_id int not null,
start_time timestamptz not null,
end_time timestamptz not null,
exclude using gist (resource_id with =, tstzrange(start_time, end_time) with &&)
);
and diffing against a database that does not contain the table, migra
returns a diff that creates the table and the index, but does not add the constraint to the table:
create extension if not exists "btree_gist" with schema "public" version '1.5';
create table "public"."event" (
"resource_id" integer not null,
"start_time" timestamp with time zone not null,
"end_time" timestamp with time zone not null
);
CREATE INDEX event_resource_id_tstzrange_excl ON public.event USING gist (resource_id, tstzrange(start_time, end_time));
Hey, thanks for filing this! I'll look at fixing this up as soon as I can.
Exclusion constraints are now supported!