-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #88 from bcgov/feature/PIM-1766-Rename-Databases-S…
…chemas-in-OpenShift Feature/pim 1766 rename databases schemas in open shift
- Loading branch information
Showing
13 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
cirras-underwriting-liquibase/db_preconditions/database/cirras.ddl.create_database.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
-- Database: cirras${ENV} | ||
-- Database: pituw${ENV} | ||
|
||
-- DROP DATABASE "cirras${ENV}"; | ||
-- DROP DATABASE "pituw${ENV}"; | ||
|
||
CREATE DATABASE "cirras${ENV}" | ||
CREATE DATABASE "pituw${ENV}" | ||
WITH | ||
OWNER = postgres | ||
TABLESPACE = pg_default | ||
CONNECTION LIMIT = -1; | ||
|
||
COMMENT ON DATABASE "cirras${ENV}" | ||
IS 'cirras${ENV} database containing schemas used by cirras applications and services.'; | ||
COMMENT ON DATABASE "pituw${ENV}" | ||
IS 'pituw${ENV} database containing schemas used by production insurance applications and services.'; | ||
|
||
GRANT TEMPORARY, CONNECT ON DATABASE "cirras${ENV}" TO PUBLIC; | ||
GRANT TEMPORARY, CONNECT ON DATABASE "pituw${ENV}" TO PUBLIC; | ||
|
||
GRANT ALL ON DATABASE "cirras${ENV}" TO postgres; | ||
GRANT ALL ON DATABASE "pituw${ENV}" TO postgres; |
27 changes: 27 additions & 0 deletions
27
cirras-underwriting-liquibase/scripts/03_00_xx/03_05_00/00/Readme.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--The database needs to be renamed. | ||
|
||
DEV: pituwdev | ||
QA: pituwqa | ||
DLVR: pituwdlvr | ||
TEST: pituwtest | ||
PROD: pituwprod | ||
|
||
--Before running the rename statement, shutdown these apis: | ||
- UW API | ||
- Jasper API | ||
|
||
--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 |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters