Skip to content

Commit

Permalink
PO-501 Fix minor issues with the CREATE TABLE scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-readman authored and RustyHMCTS committed Jul 9, 2024
1 parent 7e31376 commit b3d8473
Showing 1 changed file with 26 additions and 0 deletions.
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;

0 comments on commit b3d8473

Please sign in to comment.