@geekmidas/cli 0.50.0 → 0.51.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -30,7 +30,7 @@ import prompts from "prompts";
30
30
 
31
31
  //#region package.json
32
32
  var name = "@geekmidas/cli";
33
- var version = "0.50.0";
33
+ var version = "0.51.0";
34
34
  var description = "CLI tools for building Lambda handlers, server applications, and generating OpenAPI specs";
35
35
  var private$1 = false;
36
36
  var type = "module";
@@ -5207,9 +5207,11 @@ async function initializePostgresUsers(api, postgres, serverHostname, users) {
5207
5207
  logger$1.log(` Creating user "${user.name}" with schema "${schemaName}"...`);
5208
5208
  await client.query(`
5209
5209
  DO $$ BEGIN
5210
- CREATE USER "${user.name}" WITH PASSWORD '${user.password}';
5211
- EXCEPTION WHEN duplicate_object THEN
5212
- ALTER USER "${user.name}" WITH PASSWORD '${user.password}';
5210
+ IF NOT EXISTS (SELECT FROM pg_roles WHERE rolname = '${user.name}') THEN
5211
+ CREATE USER "${user.name}" WITH PASSWORD '${user.password}';
5212
+ ELSE
5213
+ ALTER USER "${user.name}" WITH PASSWORD '${user.password}';
5214
+ END IF;
5213
5215
  END $$;
5214
5216
  `);
5215
5217
  if (user.usePublicSchema) await client.query(`