summaryrefslogtreecommitdiff
path: root/hosts/surtr/postgresql/default.nix
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2024-05-25 20:37:25 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2024-05-25 20:37:25 +0200
commit329de92b6e00f1af9925f56a4fc6da14087802e5 (patch)
treeefc06ae01168bff5db83907c96e51ed54bfdd32b /hosts/surtr/postgresql/default.nix
parent2f8b062363b293a72e4afa0e682f1c4371317515 (diff)
downloadnixos-329de92b6e00f1af9925f56a4fc6da14087802e5.tar
nixos-329de92b6e00f1af9925f56a4fc6da14087802e5.tar.gz
nixos-329de92b6e00f1af9925f56a4fc6da14087802e5.tar.bz2
nixos-329de92b6e00f1af9925f56a4fc6da14087802e5.tar.xz
nixos-329de92b6e00f1af9925f56a4fc6da14087802e5.zip
tkleen
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" ''