Contraints on columns using collation cause false-positives
quantus opened this issue · comments
Pekka Pöyry commented
Migra always tries to recreate a unique constraints when the column uses collation.
Reproduction steps:
test.sql
:
CREATE COLLATION "numeric" (provider = icu, locale = 'en@colNumeric=yes');
CREATE TABLE foo (
bar character varying NOT NULL COLLATE "numeric"
);
ALTER TABLE foo ADD CONSTRAINT uq_bar UNIQUE (bar);
Run:
createdb a
psql a < test.sql
createdb b
psql b < test.sql
migra --unsafe postgresql:///a postgresql:///b
Output:
alter table "public"."foo" drop constraint "uq_bar";
drop index if exists "public"."uq_bar";
CREATE UNIQUE INDEX uq_bar ON public.foo USING btree (bar);
alter table "public"."foo" add constraint "uq_bar" UNIQUE using index "uq_bar";
Robert Lechte commented
Thanks for filing this issue! This should be fixed as of the latest schemainspect release.