summaryrefslogtreecommitdiff
path: root/hosts/surtr/postgresql/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/surtr/postgresql/default.nix')
-rw-r--r--hosts/surtr/postgresql/default.nix14
1 files changed, 14 insertions, 0 deletions
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 {
262 262
263 GRANT DELETE ON "mailbox_mapping" TO "spm"; 263 GRANT DELETE ON "mailbox_mapping" TO "spm";
264 COMMIT; 264 COMMIT;
265
266 BEGIN;
267 SELECT _v.register_patch('011-password', ARRAY['000-base'], null);
268
269 ALTER TABLE mailbox ADD COLUMN password text CONSTRAINT password_non_empty CHECK (password IS DISTINCT FROM ''');
270 COMMIT;
271
272 BEGIN;
273 SELECT _v.register_patch('012-imap-password', ARRAY['000-base', '002-citext'], null);
274
275 DROP VIEW imap_user;
276 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;
277
278 COMMIT;
265 ''} 279 ''}
266 280
267 psql etebase postgres -eXf ${pkgs.writeText "etebase.sql" '' 281 psql etebase postgres -eXf ${pkgs.writeText "etebase.sql" ''