From 638c288a5cf268469f337404c84f1a5638e90fb7 Mon Sep 17 00:00:00 2001 From: Morten Olsen Date: Fri, 15 Aug 2025 20:52:17 +0200 Subject: [PATCH] update --- src/services/postgres/postgres.instance.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/services/postgres/postgres.instance.ts b/src/services/postgres/postgres.instance.ts index e97b150..bb198f7 100644 --- a/src/services/postgres/postgres.instance.ts +++ b/src/services/postgres/postgres.instance.ts @@ -42,9 +42,9 @@ class PostgresInstance { const existingRole = await this.#db.raw('SELECT 1 FROM pg_roles WHERE rolname = ?', [role.name]); if (existingRole.rows.length === 0) { - await this.#db.raw(`CREATE ROLE ${role.name} WITH LOGIN PASSWORD '${role.password}'`); + await this.#db.raw(`CREATE ROLE "${role.name}" WITH LOGIN PASSWORD '${role.password}'`); } else { - await this.#db.raw(`ALTER ROLE ${role.name} WITH PASSWORD '${role.password}'`); + await this.#db.raw(`ALTER ROLE "${role.name}" WITH PASSWORD '${role.password}'`); } }; @@ -52,9 +52,9 @@ class PostgresInstance { const existingDatabase = await this.#db.raw('SELECT * FROM pg_database WHERE datname = ?', [database.name]); if (existingDatabase.rows.length === 0) { - await this.#db.raw(`CREATE DATABASE ${database.name} OWNER ${database.owner}`); + await this.#db.raw(`CREATE DATABASE "${database.name}" OWNER "${database.owner}"`); } else { - await this.#db.raw(`ALTER DATABASE ${database.name} OWNER TO ${database.owner}`); + await this.#db.raw(`ALTER DATABASE "${database.name}" OWNER TO "${database.owner}"`); } }; }