From bdb972de346db088a1009ef801ff120016c1bfb9 Mon Sep 17 00:00:00 2001 From: abrahamdennis <148991960+abrahamdennis@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:59:12 +0000 Subject: [PATCH] PO-244 added script to update business unit ids in dependent OPAL tables to that in Legacy Oracle database (#274) --- ...9_096__update_dependent_business_units.sql | 242 ++++++++++++++++++ 1 file changed, 242 insertions(+) create mode 100644 src/main/resources/db/migration/V20240319_096__update_dependent_business_units.sql diff --git a/src/main/resources/db/migration/V20240319_096__update_dependent_business_units.sql b/src/main/resources/db/migration/V20240319_096__update_dependent_business_units.sql new file mode 100644 index 000000000..c92237835 --- /dev/null +++ b/src/main/resources/db/migration/V20240319_096__update_dependent_business_units.sql @@ -0,0 +1,242 @@ +/** +* OPAL Program +* +* MODULE : update_dependent_business_units.sql +* +* DESCRIPTION : The existing test data values for business_unit_id in dependent OPAL database tables updated to business unit id values that can be found in the Legacy GoB Oracle database +* +* VERSION HISTORY: +* +* Date Author Version Nature of Change +* ---------- ------- -------- ------------------------------------------------------------------------------------------------------------------------------------------------------------------ +* 19/03/2024 A Dennis 1.0 PO-244 The existing test data values for business_unit_id in dependent OPAL database tables updated to business unit id values that can be found in the Legacy GoB Oracle database. +* +**/ + +-- ========= DEFENDANT_ACCOUNTS table ======== + +UPDATE defendant_accounts +SET business_unit_id = 69 +WHERE business_unit_id = 5000; + +UPDATE defendant_accounts +SET business_unit_id = 94 +WHERE business_unit_id = 5001; + +UPDATE defendant_accounts +SET business_unit_id = 95 +WHERE business_unit_id = 5002; + +UPDATE defendant_accounts +SET business_unit_id = 96 +WHERE business_unit_id = 5003; + +UPDATE defendant_accounts +SET business_unit_id = 13 +WHERE business_unit_id = 5004; + +UPDATE defendant_accounts +SET business_unit_id = 16 +WHERE business_unit_id = 5005; + +UPDATE defendant_accounts +SET business_unit_id = 17 +WHERE business_unit_id = 5006; + +UPDATE defendant_accounts +SET business_unit_id = 19 +WHERE business_unit_id = 5007; + +UPDATE defendant_accounts +SET business_unit_id = 32 +WHERE business_unit_id = 5008; + +UPDATE defendant_accounts +SET business_unit_id = 64 +WHERE business_unit_id = 5009; + +-- ========= COURTS table ======== + +UPDATE courts +SET business_unit_id = 69 +WHERE business_unit_id = 5000; + +UPDATE courts +SET business_unit_id = 94 +WHERE business_unit_id = 5001; + +UPDATE courts +SET business_unit_id = 95 +WHERE business_unit_id = 5002; + +UPDATE courts +SET business_unit_id = 96 +WHERE business_unit_id = 5003; + +UPDATE courts +SET business_unit_id = 13 +WHERE business_unit_id = 5004; + +UPDATE courts +SET business_unit_id = 16 +WHERE business_unit_id = 5005; + +UPDATE courts +SET business_unit_id = 17 +WHERE business_unit_id = 5006; + +UPDATE courts +SET business_unit_id = 19 +WHERE business_unit_id = 5007; + +UPDATE courts +SET business_unit_id = 32 +WHERE business_unit_id = 5008; + +UPDATE courts +SET business_unit_id = 64 +WHERE business_unit_id = 5009; + +-- ========= PRISONS table ======== + +UPDATE prisons +SET business_unit_id = 69 +WHERE business_unit_id = 5000; + +UPDATE prisons +SET business_unit_id = 94 +WHERE business_unit_id = 5001; + +UPDATE prisons +SET business_unit_id = 95 +WHERE business_unit_id = 5009; + +UPDATE prisons +SET business_unit_id = 96 +WHERE business_unit_id = 5003; + +UPDATE prisons +SET business_unit_id = 13 +WHERE business_unit_id = 5004; + +UPDATE prisons +SET business_unit_id = 17 +WHERE business_unit_id = 5008; + +UPDATE prisons +SET business_unit_id = 19 +WHERE business_unit_id = 5007; + +-- ========= ENFORCERS table ======== + +UPDATE enforcers +SET business_unit_id = 69 +WHERE business_unit_id = 5000; + +UPDATE enforcers +SET business_unit_id = 94 +WHERE business_unit_id = 5001; + +UPDATE enforcers +SET business_unit_id = 95 +WHERE business_unit_id = 5002; + +UPDATE enforcers +SET business_unit_id = 96 +WHERE business_unit_id = 5003; + +UPDATE enforcers +SET business_unit_id = 13 +WHERE business_unit_id = 5004; + +UPDATE enforcers +SET business_unit_id = 16 +WHERE business_unit_id = 5005; + +UPDATE enforcers +SET business_unit_id = 17 +WHERE business_unit_id = 5006; + +UPDATE enforcers +SET business_unit_id = 19 +WHERE business_unit_id = 5007; + +UPDATE enforcers +SET business_unit_id = 32 +WHERE business_unit_id = 5008; + +UPDATE enforcers +SET business_unit_id = 64 +WHERE business_unit_id = 5009; + +-- ========= TILLS table ======== + +UPDATE tills +SET business_unit_id = 69 +WHERE business_unit_id = 5000; + +UPDATE tills +SET business_unit_id = 94 +WHERE business_unit_id = 5001; + +UPDATE tills +SET business_unit_id = 95 +WHERE business_unit_id = 5002; + +UPDATE tills +SET business_unit_id = 96 +WHERE business_unit_id = 5003; + +UPDATE tills +SET business_unit_id = 13 +WHERE business_unit_id = 5004; + +UPDATE tills +SET business_unit_id = 16 +WHERE business_unit_id = 5005; + +UPDATE tills +SET business_unit_id = 17 +WHERE business_unit_id = 5006; + +UPDATE tills +SET business_unit_id = 19 +WHERE business_unit_id = 5007; + +UPDATE tills +SET business_unit_id = 32 +WHERE business_unit_id = 5008; + +UPDATE tills +SET business_unit_id = 64 +WHERE business_unit_id = 5009; + +-- ========= MIS-DEBTORS table ======== + +UPDATE mis_debtors +SET business_unit_id = 69 +WHERE business_unit_id = 5000; + +UPDATE mis_debtors +SET business_unit_id = 94 +WHERE business_unit_id = 5001; + +UPDATE mis_debtors +SET business_unit_id = 95 +WHERE business_unit_id = 5002; + +UPDATE mis_debtors +SET business_unit_id = 96 +WHERE business_unit_id = 5003; + +UPDATE mis_debtors +SET business_unit_id = 13 +WHERE business_unit_id = 5004; + +UPDATE mis_debtors +SET business_unit_id = 16 +WHERE business_unit_id = 5005; + +UPDATE mis_debtors +SET business_unit_id = 17 +WHERE business_unit_id = 5006;