From 329de92b6e00f1af9925f56a4fc6da14087802e5 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sat, 25 May 2024 20:37:25 +0200 Subject: tkleen --- hosts/surtr/postgresql/default.nix | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'hosts/surtr/postgresql') diff --git a/hosts/surtr/postgresql/default.nix b/hosts/surtr/postgresql/default.nix index f0e42ee8..583e4443 100644 --- a/hosts/surtr/postgresql/default.nix +++ b/hosts/surtr/postgresql/default.nix @@ -262,6 +262,20 @@ in { GRANT DELETE ON "mailbox_mapping" TO "spm"; COMMIT; + + BEGIN; + SELECT _v.register_patch('011-password', ARRAY['000-base'], null); + + ALTER TABLE mailbox ADD COLUMN password text CONSTRAINT password_non_empty CHECK (password IS DISTINCT FROM '''); + COMMIT; + + BEGIN; + SELECT _v.register_patch('012-imap-password', ARRAY['000-base', '002-citext'], null); + + DROP VIEW imap_user; + CREATE VIEW imap_user ("user", "password", quota_rule) AS SELECT mailbox.mailbox AS "user", "password", quota_rule FROM mailbox_quota_rule INNER JOIN mailbox ON mailbox_quota_rule.mailbox = mailbox.mailbox; + + COMMIT; ''} psql etebase postgres -eXf ${pkgs.writeText "etebase.sql" '' -- cgit v1.2.3