From 2b297b23353773237b1ce836d0f753b77e22a4f6 Mon Sep 17 00:00:00 2001 From: Marc Scholten Date: Sat, 10 Feb 2024 19:48:55 +0100 Subject: [PATCH] deploy-to-nixos: Switch to the right user before creating tables --- NixSupport/nixosModules/appWithPostgres.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/NixSupport/nixosModules/appWithPostgres.nix b/NixSupport/nixosModules/appWithPostgres.nix index 9933dd605..5eb82f380 100644 --- a/NixSupport/nixosModules/appWithPostgres.nix +++ b/NixSupport/nixosModules/appWithPostgres.nix @@ -69,6 +69,7 @@ in CREATE DATABASE ${cfg.databaseName} OWNER ${cfg.databaseUser}; GRANT ALL PRIVILEGES ON DATABASE ${cfg.databaseName} TO "${cfg.databaseUser}"; \connect ${cfg.databaseName} + SET USER ${cfg.databaseUser}; CREATE TABLE IF NOT EXISTS schema_migrations (revision BIGINT NOT NULL UNIQUE); \i ${ihp}/lib/IHP/IHPSchema.sql \i ${cfg.schema}