Skip to content

Commit 0c342cb

Browse files
authored
Merge pull request #786 from larsenle/main
Sprint 18 DB scripting
2 parents 5549dbc + 95ae80c commit 0c342cb

8 files changed

+3428
-21
lines changed

database/README.md

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Often, database object definitions are changed after the sprint modeling activit
3030
There is always a base set of fixed data that are not managed by the application, and must be populated by script. Some of these are merely temporary situations that will be resolved as stories evolve to replace them.
3131

3232
## Database Change Summaries
33-
Each sprint delivers a planned set of incremental changes to the database. The following summarizes these changes.
33+
Each sprint delivers a planned set of incremental changes to the database. The following summarizes the most recent sets of changes.
3434

3535
### Sprint 17:
3636
- Create and populate lookup table `dss_economic_region`:
@@ -48,6 +48,17 @@ Each sprint delivers a planned set of incremental changes to the database. The f
4848
- `jurisdiction_write` (for `ceu_admin`)
4949
- `bl_link_write` (for `lg_staff`)
5050

51+
### Sprint 18:
52+
- Replace procedures:
53+
- `dss_process_biz_lic_table_delete`
54+
- `dss_process_biz_lic_table_update`
55+
- Alter table `dss_business_licence`:
56+
- Replace index `dss_business_licence_i4`
57+
- Alter table `dss_rental_listing`:
58+
- Replace index `dss_rental_listing_i10`
59+
- Insert new row in table `dss_business_licence_status_type`
60+
- Update rows in table `dss_rental_listing`
61+
5162
## Database Release Management
5263
Each production release depends on the execution of a fixed set of scripts against the database schema. Generally, these are applied in the same order as they were applied to the UAT database during each sprint. The following is the order list of scripts applied to deliver each release.
5364

@@ -98,7 +109,7 @@ _Note: Master scripts are the preferred release method to use, starting with Rel
98109
- `seeding/STR_DSS_Data_Seeding_Geometry_Sprint_9.sql` **(TIP: run each MERGE statement independently)**
99110
- `utility/DSS-601_Correct_Rental_Listings_Sprint_9.sql`
100111
### Release 5 Scripts:
101-
- Master Scripts:
112+
- Master Scripts _(preferred release method)_:
102113
- `utility/STR_DSS_Migration_Sprint_11.sql`
103114
- `utility/STR_DSS_Migration_Sprint_12.sql`
104115
- `utility/STR_DSS_Migration_Sprint_13.sql`
@@ -124,9 +135,11 @@ _Note: Master scripts are the preferred release method to use, starting with Rel
124135
- `ddl/STR_DSS_Routines_Sprint_13.sql`
125136
- `utility/Correct_Rental_Listings_Sprint_13.sql`
126137
### Release 6 Scripts:
127-
- Master Scripts:
138+
- Master Scripts _(preferred release method)_:
128139
- `utility/STR_DSS_Migration_Sprint_14.sql`
129140
- `utility/STR_DSS_Migration_Sprint_15.sql`
141+
- `utility/STR_DSS_Migration_Sprint_16.sql`
142+
- `utility/STR_DSS_Migration_Sprint_17.sql`
130143
- Sprint 14:
131144
- `ddl/STR_DSS_Incremental_DB_DDL_Sprint_14.sql`
132145
- `ddl/STR_DSS_Views_Sprint_14.sql`
@@ -149,4 +162,12 @@ _Note: Master scripts are the preferred release method to use, starting with Rel
149162
- `seeding/STR_DSS_Data_Seeding_Sprint_17.sql`
150163
- `seeding/STR_DSS_Data_Seeding_LGs_Sprint_17.sql`
151164
- `seeding/STR_DSS_Data_Seeding_Geometry_Sprint_17.sql` **(TIP: run each MERGE statement independently)**
152-
- `ddl/STR_DSS_Incremental_DB_DDL_Sprint_17_post_DML.sql`
165+
- `ddl/STR_DSS_Incremental_DB_DDL_Sprint_17_post_DML.sql`
166+
### Release 7 Scripts:
167+
- Master Scripts _(preferred release method)_:
168+
- `utility/STR_DSS_Migration_Sprint_18.sql`
169+
- Sprint 18:
170+
- `ddl/STR_DSS_Incremental_DB_DDL_Sprint_18.sql`
171+
- `ddl/STR_DSS_Routines_Sprint_18.sql`
172+
- `seeding/STR_DSS_Data_Seeding_Sprint_18.sql`
173+
- `utility/Correct_Rental_Listings_Sprint_18.sql`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* Sprint 18 Incremental DB Changes to STR DSS */
2+
3+
DROP INDEX IF EXISTS dss_business_licence_i4 ;
4+
5+
CREATE INDEX IF NOT EXISTS dss_business_licence_i4 ON dss_business_licence ( regexp_replace(regexp_replace(UPPER(business_licence_no), '[^A-Z0-9]+', '', 'g'), '^0+', '') ) ;
6+
7+
DROP INDEX IF EXISTS dss_rental_listing_i10 ;
8+
9+
CREATE INDEX IF NOT EXISTS dss_rental_listing_i10 ON dss_rental_listing ( regexp_replace(regexp_replace(UPPER(business_licence_no), '[^A-Z0-9]+', '', 'g'), '^0+', '') ) ;
10+
11+
COMMENT ON TABLE dss_business_licence_status_type IS 'A potential status for a BUSINESS LICENCE (e.g. Pending, Denied, Issued, Suspended, Revoked, Cancelled, Expired)';
12+
13+
COMMENT ON COLUMN dss_business_licence_status_type.licence_status_type IS 'System-consistent code for the business licence status (e.g. Pending, Denied, Issued, Suspended, Revoked, Cancelled, Expired)';
14+
15+
COMMENT ON COLUMN dss_business_licence_status_type.licence_status_type_nm IS 'Business term for the licence status (e.g. Pending, Denied, Issued, Suspended, Revoked, Cancelled, Expired)';

0 commit comments

Comments
 (0)