Skip to content

Commit

Permalink
Merge pull request #714 from larsenle/main
Browse files Browse the repository at this point in the history
DSS-945 DB: Create new column in identity table for BCSC
  • Loading branch information
ychung-mot authored Oct 17, 2024
2 parents 5754c48 + bb79710 commit f7f3f3b
Show file tree
Hide file tree
Showing 13 changed files with 10,063 additions and 0 deletions.
5 changes: 5 additions & 0 deletions database/ddl/STR_DSS_Incremental_DB_DDL_Sprint_16.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Sprint 16 Incremental DB Changes to STR DSS */

ALTER TABLE dss_user_identity ADD external_identity_cd varchar(100) ;

COMMENT ON COLUMN dss_user_identity.external_identity_cd IS 'A non-guid unique identifier assigned by the identity provider';
1,306 changes: 1,306 additions & 0 deletions database/ddl/STR_DSS_Physical_DB_DDL_Sprint_16.sql

Large diffs are not rendered by default.

1,749 changes: 1,749 additions & 0 deletions database/model/PhysicalDataDiagram(Sprint15).svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,748 changes: 1,748 additions & 0 deletions database/model/PhysicalDataDiagram(Sprint16).svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
808 changes: 808 additions & 0 deletions database/model/STR_DSS_Physical_DB_Design_Sprint_15.md

Large diffs are not rendered by default.

Binary file not shown.
1,553 changes: 1,553 additions & 0 deletions database/model/STR_DSS_Physical_DB_Design_Sprint_16.dbs

Large diffs are not rendered by default.

809 changes: 809 additions & 0 deletions database/model/STR_DSS_Physical_DB_Design_Sprint_16.md

Large diffs are not rendered by default.

Binary file not shown.
1,624 changes: 1,624 additions & 0 deletions database/seeding/STR_DSS_Data_Seeding_Geometry_Sprint_16.sql

Large diffs are not rendered by default.

405 changes: 405 additions & 0 deletions database/seeding/STR_DSS_Data_Seeding_LGs_Sprint_16.sql

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions database/utility/STR_DSS_Migration_Sprint_16.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/* Sprint 16 Master Database Migration Script -- must be run from psql using the following command: \i '<folder>/<script>' (must use / rather than \) */
\conninfo
\encoding UTF8
\set VERBOSITY terse
\set ECHO none
\set QUIET on
\set AUTOCOMMIT off
START TRANSACTION;
SET search_path TO dss,public; /*schema name dss ignored if it does not exist*/
SELECT current_schema() as dflt_schema
\gset
select exists(
select 1 from information_schema.tables where table_name like 'dss%')
as db_has_dss_tab
\gset
select exists(
select 1 from information_schema.columns where column_name='external_identity_cd' and table_name='dss_user_identity' and table_schema=:'dflt_schema')
as db_has_s16_col
\gset
select exists(
select 1 from information_schema.columns where column_name='platform_type' and table_name='dss_organization' and table_schema=:'dflt_schema')
as db_has_s15_col
\gset
\if :db_has_s16_col
\echo 'Sprint 16 migration appears complete - Exiting without changes'
\elif :db_has_s15_col
\echo 'Sprint 15 migration appears complete - Beginning upgrade to Sprint 16'
\echo 'Calling STR_DSS_Incremental_DB_DDL_Sprint_16.sql'
\ir '../ddl/STR_DSS_Incremental_DB_DDL_Sprint_16.sql'
\echo 'Adding/replacing views'
\ir '../ddl/STR_DSS_Views_Sprint_16.sql'
\echo 'Calling STR_DSS_Data_Seeding_LGs_Sprint_16.sql'
\ir '../seeding/STR_DSS_Data_Seeding_LGs_Sprint_16.sql'
\elif :db_has_dss_tab
\echo 'Database migration state is unknown - Exiting without changes'
\else
\echo 'Database has no DSS tables - Beginning complete build to Sprint 16'
\echo 'Calling STR_DSS_Physical_DB_DDL_Sprint_16.sql'
\ir '../ddl/STR_DSS_Physical_DB_DDL_Sprint_16.sql'
\echo 'Calling STR_DSS_Data_Seeding_Sprint_15.sql'
\ir '../seeding/STR_DSS_Data_Seeding_Sprint_15.sql'
\echo 'Calling STR_DSS_Data_Seeding_LGs_Sprint_16.sql'
\ir '../seeding/STR_DSS_Data_Seeding_LGs_Sprint_16.sql'
\echo 'Calling STR_DSS_Data_Seeding_Geometry_Sprint_16.sql'
\ir '../seeding/STR_DSS_Data_Seeding_Geometry_Sprint_16.sql'
\echo 'Users, platforms, and their contacts must be added in the application'
\endif
\if :ERROR
/*commit cannot succeed because transaction was aborted due to an error*/
\echo 'Undoing transaction'
ROLLBACK;
\else
\echo 'Committing transaction'
COMMIT;
\endif
\echo done!

0 comments on commit f7f3f3b

Please sign in to comment.