From ed70953370cbec992b7d1d2d05e4263ff8cc27ad Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 16 Dec 2022 20:34:28 +0100 Subject: ... --- hosts/surtr/postgresql/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hosts/surtr') diff --git a/hosts/surtr/postgresql/default.nix b/hosts/surtr/postgresql/default.nix index 907c652d..79b17f5a 100644 --- a/hosts/surtr/postgresql/default.nix +++ b/hosts/surtr/postgresql/default.nix @@ -226,10 +226,10 @@ in { ALTER TABLE mailbox_mapping DROP CONSTRAINT mailbox_mapping_extension_check; ALTER TABLE mailbox_mapping ADD CONSTRAINT mailbox_mapping_extension_check CHECK (CASE WHEN extension IS NOT NULL THEN extension NOT LIKE '%+%' AND extension <> ''' AND local IS DISTINCT FROM ''' ELSE true END); - ALTER TABLE mailbox_mapping DROP CONSTRAINT local_domain_unique; - ALTER TABLE mailbox_mapping ADD CONSTRAINT local_domain_unique UNIQUE (local, domain) WHERE extension IS null; + DROP INDEX local_domain_unique; + CREATE UNIQUE INDEX local_domain_unique ON (local, domain) WHERE extension IS null; - ALTER TABLE mailbox_mapping ADD CONSTRAINT local_extension_domain_unique UNIQUE (local, extension, domain); + CREATE UNIQUE INDEX local_extension_domain_unique ON (local, extension, domain); ALTER TABLE mailbox_mapping ADD COLUMN reject bool NOT NULL DEFAULT false; -- cgit v1.2.3