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-501 Fix minor issues with the CREATE TABLE scripts
- Loading branch information
1 parent
7e31376
commit b3d8473
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
...ain/resources/db/migration/V20240709_219__standard_letters_fk_report_entries_not_null.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,26 @@ | ||
/** | ||
* | ||
* OPAL Program | ||
* | ||
* MODULE : standard_letters_report_entries_fix.sql | ||
* | ||
* DESCRIPTION : Rename constraint for STANDARD_LETTERS and set REPORT_ENTRIES columns to be not null. | ||
* | ||
* VERSION HISTORY: | ||
* | ||
* Date Author Version Nature of Change | ||
* ---------- -------- -------- --------------------------------------------------------------------------------------------------------- | ||
* 09/07/2024 I Readman 1.0 PO-501 Fix minor issues with the CREATE TABLE scripts | ||
* | ||
**/ | ||
|
||
-- Rename Constraint | ||
ALTER TABLE standard_letters RENAME CONSTRAINT ct_business_unit_id_fk TO sl_business_unit_id_fk; | ||
|
||
-- Set columns to NOT NULL | ||
ALTER TABLE report_entries ALTER business_unit_id SET NOT NULL; | ||
ALTER TABLE report_entries ALTER report_id SET NOT NULL; | ||
ALTER TABLE report_entries ALTER entry_timestamp SET NOT NULL; | ||
ALTER TABLE report_entries ALTER reported_timestamp SET NOT NULL; | ||
ALTER TABLE report_entries ALTER associated_record_type SET NOT NULL; | ||
ALTER TABLE report_entries ALTER associated_record_id SET NOT NULL; |