generated from hmcts/spring-boot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PO-387 445 and 451 to add indexes to offences table and new columns t…
…o business_units and aliases tables (#429) Co-authored-by: RustyHMCTS <149379845+RustyHMCTS@users.noreply.github.com> Co-authored-by: Cade Faulkner <147704481+CadeFaulkner@users.noreply.github.com>
- Loading branch information
1 parent
b03f626
commit 1bcf589
Showing
4 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
src/main/resources/db/migration/V20240704_215__add_org_name_to_aliases.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* OPAL Program | ||
* | ||
* MODULE : add_org_name_to_aliases.sql | ||
* | ||
* DESCRIPTION : Add organisation_name column to the ALIASES table so we don't use surname column for organisations. | ||
* | ||
* VERSION HISTORY: | ||
* | ||
* Date Author Version Nature of Change | ||
* ---------- ------- -------- ---------------------------------------------------------------------------------------------------------------------------- | ||
* 04/07/2024 A Dennis 1.0 PO-445 Add organisation_name column to the ALIASES table so we don't use surname column for organisations. | ||
* | ||
**/ | ||
ALTER TABLE aliases | ||
ADD COLUMN organisation_name varchar(50); | ||
|
||
COMMENT ON COLUMN aliases.organisation_name IS 'Alias organisation name'; |
18 changes: 18 additions & 0 deletions
18
src/main/resources/db/migration/V20240704_216__add_welsh_lang_to_business_units.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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* OPAL Program | ||
* | ||
* MODULE : add_welsh_to_business_units.sql | ||
* | ||
* DESCRIPTION : Add welsh_languague column to the BUSINESS_UNITS table so to identify them in the database during data retrieval. | ||
* | ||
* VERSION HISTORY: | ||
* | ||
* Date Author Version Nature of Change | ||
* ---------- ------- -------- ---------------------------------------------------------------------------------------------------------------------------------------- | ||
* 04/07/2024 A Dennis 1.0 PO-451 Add welsh_languague column to the BUSINESS_UNITS table so to identify them in the OPAL database. It does not exist in Legacy GoB. | ||
* | ||
**/ | ||
ALTER TABLE business_units | ||
ADD COLUMN welsh_language boolean; | ||
|
||
COMMENT ON COLUMN business_units.welsh_language IS 'To identify if this is a welsh language business unit in Opal. It does not exist in Legacy GoB'; |
29 changes: 29 additions & 0 deletions
29
src/main/resources/db/migration/V20240704_217__update_welsh_business_units.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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* OPAL Program | ||
* | ||
* MODULE : update_welsh_business_units.sql | ||
* | ||
* DESCRIPTION : Update the business_units table to indicate the Welsh business units. | ||
* | ||
* VERSION HISTORY: | ||
* | ||
* Date Author Version Nature of Change | ||
* ---------- ------- -------- ---------------------------------------------------------------------------- | ||
* 04/07/2024 A Dennis 1.0 PO-451 Update the business_units table to indicate the Welsh business units. | ||
* | ||
**/ | ||
|
||
UPDATE business_units | ||
SET welsh_language = TRUE | ||
WHERE business_unit_code = '60' | ||
AND business_unit_type = 'Area'; | ||
|
||
UPDATE business_units | ||
SET welsh_language = TRUE | ||
WHERE business_unit_code = '61' | ||
AND business_unit_type = 'Area'; | ||
|
||
UPDATE business_units | ||
SET welsh_language = TRUE | ||
WHERE business_unit_code = '63' | ||
AND business_unit_type = 'Area'; |
17 changes: 17 additions & 0 deletions
17
src/main/resources/db/migration/V20240704_218__index_offences.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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/** | ||
* OPAL Program | ||
* | ||
* MODULE : index_offences.sql | ||
* | ||
* DESCRIPTION : Create indexes on columns in OFFENCES table that will be used in searches. | ||
* | ||
* VERSION HISTORY: | ||
* | ||
* Date Author Version Nature of Change | ||
* ---------- ------- -------- --------------------------------------------------------------------------------------------------------- | ||
* 04/07/2024 A Dennis 1.0 PO-387 Create an index on log_timestamp column in the log_audit_details table. | ||
* | ||
**/ | ||
CREATE INDEX IF NOT EXISTS off_cjs_code_idx ON offences(cjs_code); | ||
CREATE INDEX IF NOT EXISTS off_offence_title_idx ON offences(offence_title); | ||
CREATE INDEX IF NOT EXISTS off_offence_oas_idx ON offences(offence_oas); |