summaryrefslogtreecommitdiff
path: root/hosts/surtr/postgresql.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2022-05-05 18:12:55 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2022-05-05 18:12:55 +0200
commite9c1d4c91d770f20a06473209aaba5c48c1ec84a (patch)
tree272ada237db7826c17748795fa1034b1a29eae31 /hosts/surtr/postgresql.nix
parent3b60dab1dbf2b435d3c1281a27e46bb27c42a521 (diff)
downloadnixos-e9c1d4c91d770f20a06473209aaba5c48c1ec84a.tar
nixos-e9c1d4c91d770f20a06473209aaba5c48c1ec84a.tar.gz
nixos-e9c1d4c91d770f20a06473209aaba5c48c1ec84a.tar.bz2
nixos-e9c1d4c91d770f20a06473209aaba5c48c1ec84a.tar.xz
nixos-e9c1d4c91d770f20a06473209aaba5c48c1ec84a.zip
...
Diffstat (limited to 'hosts/surtr/postgresql.nix')
-rw-r--r--hosts/surtr/postgresql.nix16
1 files changed, 7 insertions, 9 deletions
diff --git a/hosts/surtr/postgresql.nix b/hosts/surtr/postgresql.nix
index 510437aa..ca56f60c 100644
--- a/hosts/surtr/postgresql.nix
+++ b/hosts/surtr/postgresql.nix
@@ -28,18 +28,16 @@ in {
28 \i ${versioning + "/install.versioning.sql"} 28 \i ${versioning + "/install.versioning.sql"}
29 29
30 BEGIN; 30 BEGIN;
31 select _v.register_patch('000-base', null, null); 31 SELECT _v.register_patch('000-base', null, null);
32 32
33 create table virtual_mailbox ( 33 CREATE TABLE virtual_mailbox (
34 id uuid PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(), 34 id uuid PRIMARY KEY NOT NULL DEFAULT gen_random_uuid(),
35 local text, 35 local text CONSTRAINT local_non_empty CHECK (local IS DISTINCT FROM '''),
36 CHECK (local IS DISTINCT FROM '''), 36 domain text NOT NULL CONSTRAINT domain_non_empty CHECK (domain <> '''),
37 domain text NOT NULL, 37 mailbox text NOT NULL CONSTRAINT mailbox_non_empty CHECK (mailbox <> '''),
38 CHECK (domain <> '''), 38 CONSTRAINT local_domain_unique UNIQUE (local, domain)
39 mailbox text NOT NULL,
40 CHECK (mailbox <> '''),
41 UNIQUE(COALESCE(local, '''), domain)
42 ); 39 );
40 CREATE UNIQUE INDEX domain_unique ON TABLE virtual_mailbox (domain) WHERE local IS NULL;
43 COMMIT; 41 COMMIT;
44 ''} 42 ''}
45 ''; 43 '';