summaryrefslogtreecommitdiff
path: root/hosts/surtr/postgresql
diff options
context:
space:
mode:
authorGregor Kleen <gkleen@yggdrasil.li>2024-08-08 14:36:50 +0200
committerGregor Kleen <gkleen@yggdrasil.li>2024-08-08 14:36:50 +0200
commitbe06f04babc12fb60366c24a22561c1d46895c80 (patch)
tree8df057a3605a7272cb048043be7593b5c944a67c /hosts/surtr/postgresql
parenta6754d729f2d16cfdcb3570891c038a14718de1f (diff)
parentbc90ef66903e78713db1fd3a700785572b794cde (diff)
downloadnixos-be06f04babc12fb60366c24a22561c1d46895c80.tar
nixos-be06f04babc12fb60366c24a22561c1d46895c80.tar.gz
nixos-be06f04babc12fb60366c24a22561c1d46895c80.tar.bz2
nixos-be06f04babc12fb60366c24a22561c1d46895c80.tar.xz
nixos-be06f04babc12fb60366c24a22561c1d46895c80.zip
Merge commit 'bc90ef66' into flakes
Diffstat (limited to 'hosts/surtr/postgresql')
-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" ''