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-303 loaded the offences reference data from an Excal spreadsheet i…
…nto the database table
- Loading branch information
1 parent
7039d34
commit 855e472
Showing
2 changed files
with
18,261 additions
and
0 deletions.
There are no files selected for viewing
42 changes: 42 additions & 0 deletions
42
src/main/resources/db/migration/V20240425_138__modify_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,42 @@ | ||
/** | ||
* OPAL Program | ||
* | ||
* MODULE : modify_offences.sql | ||
* | ||
* DESCRIPTION : Modify the OFFENCES table in order to be able to load Reference Data from data held in Excel spreadsheet. | ||
* | ||
* VERSION HISTORY: | ||
* | ||
* Date Author Version Nature of Change | ||
* ---------- ------- -------- --------------------------------------------------------------------------------------------------------------- | ||
* 25/04/2024 A Dennis 1.0 PO-303 Modify the OFFENCES table in order to be able to load Reference Data from data held in Excel spreadsheet | ||
* | ||
**/ | ||
ALTER TABLE offences | ||
ADD COLUMN date_used_to timestamp, | ||
ADD COLUMN offence_oas text, | ||
ADD COLUMN offence_oas_cy text; | ||
|
||
ALTER TABLE offences | ||
ALTER COLUMN offence_id TYPE bigint | ||
USING offence_id::bigint; | ||
|
||
ALTER TABLE IF EXISTS offences | ||
DROP constraint IF EXISTS off_business_unit_id_fk; | ||
|
||
ALTER TABLE offences | ||
ALTER COLUMN business_unit_id DROP NOT NULL; | ||
|
||
ALTER TABLE offences | ||
ALTER COLUMN offence_title DROP NOT NULL; | ||
|
||
ALTER TABLE offences | ||
ALTER COLUMN offence_title_cy DROP NOT NULL; | ||
|
||
ALTER TABLE impositions | ||
ALTER COLUMN offence_id TYPE bigint | ||
USING offence_id::bigint; | ||
|
||
COMMENT ON COLUMN offences.date_used_to IS 'The date the offence was in use till. Null of a date in the future means still in use'; | ||
COMMENT ON COLUMN offences.offence_oas IS 'The English Offence Act and Section/Legislation'; | ||
COMMENT ON COLUMN offences.offence_oas_cy IS 'The Welsh Offence Act and Section/Legislation'; |
Oops, something went wrong.