Skip to content

Commit

Permalink
BRMO-374: Staging upgrade scripts om niet langer bestaande jobs te ve…
Browse files Browse the repository at this point in the history
…rwijderen
  • Loading branch information
mprins committed Nov 28, 2024
1 parent ceaed29 commit 8c79038
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
10 changes: 10 additions & 0 deletions datamodel/upgrade_scripts/4.0.0-5.0.0/oracle/staging.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

WHENEVER SQLERROR EXIT SQL.SQLCODE

-- opruimen van niet langer beschikbare automatische scanner processen
DELETE FROM automatisch_proces_config WHERE proces_id IN (SELECT id FROM automatisch_proces WHERE dtype IN ('BRKScannerProces'));
DELETE FROM automatisch_proces WHERE dtype IN ('BRKScannerProces');

-- BRK1 GDS2 processen verwijderen
CREATE TABLE tmp_pids AS (SELECT apc.proces_id FROM automatisch_proces_config apc WHERE to_char(apc.value)='brk' AND apc.config_key='gds2_br_soort');
DELETE FROM automatisch_proces_config WHERE proces_id IN (SELECT proces_id FROM tmp_pids);
DELETE FROM automatisch_proces WHERE id IN (SELECT proces_id FROM tmp_pids);
DROP TABLE tmp_pids;


-- onderstaande dienen als laatste stappen van een upgrade uitgevoerd
INSERT INTO brmo_metadata (naam,waarde) SELECT 'upgrade_4.0.0_naar_5.0.0','vorige versie was ' || waarde FROM brmo_metadata WHERE naam='brmoversie';
Expand Down
8 changes: 8 additions & 0 deletions datamodel/upgrade_scripts/4.0.0-5.0.0/postgresql/staging.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
--
-- upgrade PostgreSQL STAGING datamodel van 4.0.0 naar 5.0.0
--
-- opruimen van niet langer beschikbare automatische scanner processen
DELETE FROM automatisch_proces_config WHERE proces_id IN (SELECT id FROM automatisch_proces WHERE dtype IN ('BRKScannerProces'));
DELETE FROM automatisch_proces WHERE dtype IN ('BRKScannerProces');

-- BRK1 GDS2 processen verwijderen
CREATE TEMP TABLE pids AS SELECT apc.proces_id FROM automatisch_proces_config apc WHERE apc.value = 'brk' AND apc.config_key='gds2_br_soort';
DELETE FROM automatisch_proces_config WHERE proces_id IN (SELECT proces_id FROM pids);
DELETE FROM automatisch_proces WHERE id IN (SELECT proces_id FROM pids);
DROP TABLE pids;

-- onderstaande dienen als laatste stappen van een upgrade uitgevoerd
INSERT INTO brmo_metadata (naam,waarde) SELECT 'upgrade_4.0.0_naar_5.0.0','vorige versie was ' || waarde FROM brmo_metadata WHERE naam='brmoversie';
Expand Down

0 comments on commit 8c79038

Please sign in to comment.