mirror of
https://github.com/nmasur/dotfiles
synced 2026-10-29 10:45:02 +00:00
fix(services): require postgresql.target in pgweb/mathesar and refresh all db collations
This commit is contained in:
1 parent
b3d9938f10
commit
9a458530d0
4 files changed
+12
-2
No files matched your search
@@ -30,6 +30,7 @@ in
|
||||
"postgresql.target"
|
||||
];
|
||||
requires = [
|
||||
"postgresql.target"
|
||||
"mathesar-secret.service"
|
||||
"mathesar-postgres-secret.service"
|
||||
];
|
||||
|
||||
@@ -28,6 +28,9 @@ in
|
||||
after = [
|
||||
"postgresql.target"
|
||||
];
|
||||
requires = [
|
||||
"postgresql.target"
|
||||
];
|
||||
# requires = [ "pgweb-secret.service" ];
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
serviceConfig = {
|
||||
|
||||
@@ -45,8 +45,9 @@ in
|
||||
if ! systemctl is-active --quiet postgresql.service; then break; fi
|
||||
sleep 0.1
|
||||
done
|
||||
${config.services.postgresql.package}/bin/psql -d postgres -tAc 'ALTER DATABASE template1 REFRESH COLLATION VERSION;' || true
|
||||
${config.services.postgresql.package}/bin/psql -d postgres -tAc 'ALTER DATABASE postgres REFRESH COLLATION VERSION;' || true
|
||||
for db in $(${config.services.postgresql.package}/bin/psql -d postgres -tAc 'SELECT datname FROM pg_database WHERE datallowconn;'); do
|
||||
${config.services.postgresql.package}/bin/psql -d postgres -tAc "ALTER DATABASE \"$db\" REFRESH COLLATION VERSION;" || true
|
||||
done
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user