fix: fixed database timezone alter not working

This commit is contained in:
Leyla Becker 2025-09-16 12:40:19 -05:00
parent e2e07c9a70
commit 1b1a3f7219

View file

@ -223,7 +223,7 @@ in {
# TODO: start sg blur config
})
(lib.mkIf config.services.panoramax.database.createDB {
services.postgresql = lib.mkIf config.services.panoramax.database.enable {
services.postgresql = {
enable = true;
ensureDatabases = lib.mkIf config.services.panoramax.database.createDB [config.services.panoramax.database.name];
ensureUsers = lib.mkIf config.services.panoramax.database.createDB [
@ -239,7 +239,8 @@ in {
sqlFile = pkgs.writeText "panoramax-postgis-setup.sql" ''
CREATE EXTENSION IF NOT EXISTS postgis;
ALTER DATABASE ${config.services.panoramax.database.name} SET TIMEZONE TO 'UTC';
-- TODO: how can we ensure that this runs after the databases have been created
-- ALTER DATABASE ${config.services.panoramax.database.name} SET TIMEZONE TO 'UTC';
GRANT SET ON PARAMETER session_replication_role TO ${config.services.panoramax.database.user};
'';