From 273c395e52ea8eb43b96df53cc5555f93675cf8c Mon Sep 17 00:00:00 2001 From: Michael Hostettler Date: Mon, 28 Oct 2024 10:02:26 -0700 Subject: [PATCH] PIM-1766: Added release script to rename the database and moved other scripts to 01 folder --- cirras-underwriting-liquibase/changelog.json | 4 ++-- .../scripts/03_00_xx/03_05_00/00/Readme.txt | 23 +++++++++++++++++++ .../cirras.cuws.03_05_00_01.ddl.json} | 0 .../cirras.cuws.03_05_00_01.dml.json} | 0 .../ddl/grants/cuws.ddl.apply_grants.sql | 0 ...r.declared_yield_contract_cmdty_forage.sql | 0 .../tables/cuws.alter.inventory_unseeded.sql | 0 ...ws.create.declared_yield_rollup_forage.sql | 0 ...ws.insert.declared_yield_rollup_forage.sql | 0 ...e.declared_yield_contract_cmdty_forage.sql | 0 10 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/Readme.txt rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00/cirras.cuws.03_05_00_00.ddl.json => 01/cirras.cuws.03_05_00_01.ddl.json} (100%) rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00/cirras.cuws.03_05_00_00.dml.json => 01/cirras.cuws.03_05_00_01.dml.json} (100%) rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00 => 01}/ddl/grants/cuws.ddl.apply_grants.sql (100%) rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00 => 01}/ddl/tables/cuws.alter.declared_yield_contract_cmdty_forage.sql (100%) rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00 => 01}/ddl/tables/cuws.alter.inventory_unseeded.sql (100%) rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00 => 01}/ddl/tables/cuws.create.declared_yield_rollup_forage.sql (100%) rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00 => 01}/dml/cuws.insert.declared_yield_rollup_forage.sql (100%) rename cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/{00 => 01}/dml/cuws.update.declared_yield_contract_cmdty_forage.sql (100%) diff --git a/cirras-underwriting-liquibase/changelog.json b/cirras-underwriting-liquibase/changelog.json index d8190d80..2d16ba6b 100644 --- a/cirras-underwriting-liquibase/changelog.json +++ b/cirras-underwriting-liquibase/changelog.json @@ -15,7 +15,7 @@ { "include": {"file": "scripts/03_00_xx/03_01_01/00/cirras.cuws.03_01_01_00.drop.ddl.json"} }, { "include": {"file": "scripts/03_00_xx/03_02_00/00/cirras.cuws.03_02_00_00.ddl.json"} }, { "include": {"file": "scripts/03_00_xx/03_03_00/00/cirras.cuws.03_03_00_00.ddl.json"} }, - { "include": {"file": "scripts/03_00_xx/03_05_00/00/cirras.cuws.03_05_00_00.ddl.json"} }, - { "include": {"file": "scripts/03_00_xx/03_05_00/00/cirras.cuws.03_05_00_00.dml.json"} } + { "include": {"file": "scripts/03_00_xx/03_05_00/01/cirras.cuws.03_05_00_01.ddl.json"} }, + { "include": {"file": "scripts/03_00_xx/03_05_00/01/cirras.cuws.03_05_00_01.dml.json"} } ] } diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/Readme.txt b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/Readme.txt new file mode 100644 index 00000000..057dd0c9 --- /dev/null +++ b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/Readme.txt @@ -0,0 +1,23 @@ +--The database needs to be renamed. + +DEV: pituwdev +QA: pituwqa +DLVR: pituwdlvr +TEST: pituwtest +PROD: pituwprod + +--Rename sql has to be run: ALTER DATABASE old_database_name RENAME TO new_database_name; + +DEV: ALTER DATABASE cirrasdev RENAME TO pituwdev; +QA: ALTER DATABASE cirrasqa RENAME TO pituwqa; +DLVR: ALTER DATABASE cirrasdlvr RENAME TO pituwdlvr; +TEST: ALTER DATABASE cirrastest RENAME TO pituwtest; +PROD: ALTER DATABASE cirrasprod RENAME TO pituwprod; + + +Possible Error if there are sessions using the database: + There are X other sessions using the database.database "cirras_dev" is being accessed by other users + ERROR: database "cirrasdev" is being accessed by other users + SQL state: 55006 + +Solution: SELECT pg_terminate_backend( pid ) FROM pg_stat_activity WHERE pid <> pg_backend_pid( ) AND datname = 'cirrasdev'; //WHERE cirrasdev is the old database name diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/cirras.cuws.03_05_00_00.ddl.json b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/cirras.cuws.03_05_00_01.ddl.json similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/cirras.cuws.03_05_00_00.ddl.json rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/cirras.cuws.03_05_00_01.ddl.json diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/cirras.cuws.03_05_00_00.dml.json b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/cirras.cuws.03_05_00_01.dml.json similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/cirras.cuws.03_05_00_00.dml.json rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/cirras.cuws.03_05_00_01.dml.json diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/grants/cuws.ddl.apply_grants.sql b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/grants/cuws.ddl.apply_grants.sql similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/grants/cuws.ddl.apply_grants.sql rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/grants/cuws.ddl.apply_grants.sql diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/tables/cuws.alter.declared_yield_contract_cmdty_forage.sql b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/tables/cuws.alter.declared_yield_contract_cmdty_forage.sql similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/tables/cuws.alter.declared_yield_contract_cmdty_forage.sql rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/tables/cuws.alter.declared_yield_contract_cmdty_forage.sql diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/tables/cuws.alter.inventory_unseeded.sql b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/tables/cuws.alter.inventory_unseeded.sql similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/tables/cuws.alter.inventory_unseeded.sql rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/tables/cuws.alter.inventory_unseeded.sql diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/tables/cuws.create.declared_yield_rollup_forage.sql b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/tables/cuws.create.declared_yield_rollup_forage.sql similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/ddl/tables/cuws.create.declared_yield_rollup_forage.sql rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/ddl/tables/cuws.create.declared_yield_rollup_forage.sql diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/dml/cuws.insert.declared_yield_rollup_forage.sql b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/dml/cuws.insert.declared_yield_rollup_forage.sql similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/dml/cuws.insert.declared_yield_rollup_forage.sql rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/dml/cuws.insert.declared_yield_rollup_forage.sql diff --git a/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/dml/cuws.update.declared_yield_contract_cmdty_forage.sql b/cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/dml/cuws.update.declared_yield_contract_cmdty_forage.sql similarity index 100% rename from cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/dml/cuws.update.declared_yield_contract_cmdty_forage.sql rename to cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/01/dml/cuws.update.declared_yield_contract_cmdty_forage.sql