From bf18cb0d5de859550a989a237fdbfb0973dcaf92 Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sun, 23 Nov 2025 20:39:54 -0600 Subject: [PATCH] grant database ownership --- homelab-services/postgresql-db/flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/homelab-services/postgresql-db/flake.nix b/homelab-services/postgresql-db/flake.nix index 548f83a..223330d 100644 --- a/homelab-services/postgresql-db/flake.nix +++ b/homelab-services/postgresql-db/flake.nix @@ -152,6 +152,10 @@ # Give users privileges on databases (always) $psql_bin -c "GRANT ALL PRIVILEGES ON DATABASE "$db" TO "$user_val";" $psql_bin -c "GRANT ALL PRIVILEGES ON DATABASE "$db"_dev TO "$dev_user_val";" + + # Grant ownership + $psql_bin -c "ALTER DATABASE "$db" OWNER TO "$user_val";" + $psql_bin -c "ALTER DATABASE "$db"_dev OWNER TO "$dev_user_val";" done '';