From e706d4d0b11cced3ede32af46f54c3929e46efb8 Mon Sep 17 00:00:00 2001 From: Ugur Cenar Date: Mon, 27 Nov 2023 08:56:56 +0100 Subject: [PATCH] Splitt flyway script i to deler --- ....35__update_sivilstand_sivilstand_type.sql | 20 ++++++++++++++++++ ...pdate_barn_i_hustand_periode_bostatus.sql} | 21 ------------------- 2 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 src/main/resources/db/migration/V1.0.35__update_sivilstand_sivilstand_type.sql rename src/main/resources/db/migration/{V1.0.35__update_boforhold_sivilstand_kodeverk.sql => V1.0.36__update_barn_i_hustand_periode_bostatus.sql} (57%) diff --git a/src/main/resources/db/migration/V1.0.35__update_sivilstand_sivilstand_type.sql b/src/main/resources/db/migration/V1.0.35__update_sivilstand_sivilstand_type.sql new file mode 100644 index 000000000..336ad277d --- /dev/null +++ b/src/main/resources/db/migration/V1.0.35__update_sivilstand_sivilstand_type.sql @@ -0,0 +1,20 @@ +-- Table: SIVILSTAND + +alter table SIVILSTAND + rename column SIVILSTAND_TYPE to SIVILSTAND_TYPE_OLD; + +ALTER TABLE SIVILSTAND + ADD COLUMN SIVILSTAND TEXT; + +UPDATE SIVILSTAND +SET SIVILSTAND = 'GIFT_SAMBOER' +WHERE SIVILSTAND_TYPE_OLD = 'GIFT'; + +UPDATE SIVILSTAND +SET SIVILSTAND = 'BOR_ALENE_MED_BARN' +WHERE SIVILSTAND_TYPE_OLD = 'BOR_ALENE_MED_BARN'; + +alter table SIVILSTAND + drop column SIVILSTAND_TYPE_OLD; + +drop type if exists SIVILSTAND_TYPE cascade; diff --git a/src/main/resources/db/migration/V1.0.35__update_boforhold_sivilstand_kodeverk.sql b/src/main/resources/db/migration/V1.0.36__update_barn_i_hustand_periode_bostatus.sql similarity index 57% rename from src/main/resources/db/migration/V1.0.35__update_boforhold_sivilstand_kodeverk.sql rename to src/main/resources/db/migration/V1.0.36__update_barn_i_hustand_periode_bostatus.sql index 11ae5a8c7..59f3cca07 100644 --- a/src/main/resources/db/migration/V1.0.35__update_boforhold_sivilstand_kodeverk.sql +++ b/src/main/resources/db/migration/V1.0.36__update_barn_i_hustand_periode_bostatus.sql @@ -1,24 +1,3 @@ --- Table: SIVILSTAND - -alter table SIVILSTAND - rename column SIVILSTAND_TYPE to SIVILSTAND_TYPE_OLD; - -ALTER TABLE SIVILSTAND - ADD COLUMN SIVILSTAND TEXT; - -UPDATE SIVILSTAND -SET SIVILSTAND = 'GIFT_SAMBOER' -WHERE SIVILSTAND_TYPE_OLD = 'GIFT'; - -UPDATE SIVILSTAND -SET SIVILSTAND = 'BOR_ALENE_MED_BARN' -WHERE SIVILSTAND_TYPE_OLD = 'BOR_ALENE_MED_BARN'; - -alter table SIVILSTAND - drop column SIVILSTAND_TYPE_OLD; - -drop type if exists SIVILSTAND_TYPE cascade; - -- Table: BARN_I_HUSSTAND_PERIODE alter table BARN_I_HUSSTAND_PERIODE add column if not exists BOSTATUS text default 'MED_FORELDER' not null;