diff --git a/backend/oko_pg_interface/scripts/bin/index.ts b/backend/oko_pg_interface/scripts/bin_backup/index.ts similarity index 100% rename from backend/oko_pg_interface/scripts/bin/index.ts rename to backend/oko_pg_interface/scripts/bin_backup/index.ts diff --git a/backend/oko_pg_interface/scripts/bin/migrate.sql b/backend/oko_pg_interface/scripts/bin_backup/migrate.sql similarity index 100% rename from backend/oko_pg_interface/scripts/bin/migrate.sql rename to backend/oko_pg_interface/scripts/bin_backup/migrate.sql diff --git a/backend/oko_pg_interface/scripts/seed/data/common.ts b/backend/oko_pg_interface/scripts/seed_backup/data/common.ts similarity index 100% rename from backend/oko_pg_interface/scripts/seed/data/common.ts rename to backend/oko_pg_interface/scripts/seed_backup/data/common.ts diff --git a/backend/oko_pg_interface/scripts/seed/data/dev.ts b/backend/oko_pg_interface/scripts/seed_backup/data/dev.ts similarity index 100% rename from backend/oko_pg_interface/scripts/seed/data/dev.ts rename to backend/oko_pg_interface/scripts/seed_backup/data/dev.ts diff --git a/backend/oko_pg_interface/scripts/seed/data/index.ts b/backend/oko_pg_interface/scripts/seed_backup/data/index.ts similarity index 100% rename from backend/oko_pg_interface/scripts/seed/data/index.ts rename to backend/oko_pg_interface/scripts/seed_backup/data/index.ts diff --git a/backend/oko_pg_interface/scripts/seed/data/prod.ts b/backend/oko_pg_interface/scripts/seed_backup/data/prod.ts similarity index 100% rename from backend/oko_pg_interface/scripts/seed/data/prod.ts rename to backend/oko_pg_interface/scripts/seed_backup/data/prod.ts diff --git a/backend/oko_pg_interface/scripts/seed/index.ts b/backend/oko_pg_interface/scripts/seed_backup/index.ts similarity index 100% rename from backend/oko_pg_interface/scripts/seed/index.ts rename to backend/oko_pg_interface/scripts/seed_backup/index.ts diff --git a/internals/ci/src/cmds/db_migrate_api.ts b/internals/ci/src/cmds/db_migrate_api.ts index aea4b45f7..e6489573c 100644 --- a/internals/ci/src/cmds/db_migrate_api.ts +++ b/internals/ci/src/cmds/db_migrate_api.ts @@ -15,7 +15,7 @@ export async function DbMigrateAPI(options: { useEnvFile: boolean }) { }; if (options.useEnvFile === false) { - console.log("Starting pg_local container"); + console.log("Start pg_local container"); const pgLocalComposeFile = path.join( paths.dockerfiles, @@ -36,7 +36,7 @@ export async function DbMigrateAPI(options: { useEnvFile: boolean }) { await waitForPgContainer(pgLocalComposeFile); } else { console.log( - "pg_local is not spanwed but we will continue as there is a change \ + "pg_local is not spanwed but we will continue as there is a chance \ that some other pg instance may be running", ); } @@ -106,16 +106,18 @@ async function ensureDatabaseExists(): Promise { await client.connect(); - const res = await client.query( - `SELECT datname FROM pg_catalog.pg_database WHERE datname = '${dbName}'`, - ); + const res = await client.query(` +SELECT datname +FROM pg_catalog.pg_database +WHERE datname = '${dbName}' +`); if (res.rowCount === 0) { console.log(`Database "${dbName}" does not exist. Creating...`); await client.query(`CREATE DATABASE "${dbName}"`); console.log(`Database "${dbName}" created.`); } else { - console.log(`Database "${dbName}" already exists.`); + console.log(`Database "${dbName}" does exist.`); } await client.end();