Liquibase-Changesets für Legacy-ID Mapping of Office-Admininistration-Tables #6

Merged
hsh-michaelhoennig merged 2 commits from legacy-id-mappings-for-db-migration into master 2024-01-05 10:58:47 +01:00
5 changed files with 26 additions and 26 deletions
Showing only changes of commit 85abe5c3cb - Show all commits

View File

@ -42,7 +42,7 @@ ALTER TABLE hs_office_contact_legacy_id
CALL defineContext('schema-migration'); CALL defineContext('schema-migration');
INSERT INTO hs_office_contact_legacy_id(uuid, contact_id) INSERT INTO hs_office_contact_legacy_id(uuid, contact_id)
SELECT uuid, nextVal('hs_office_contact_legacy_id_seq') FROM hs_office_contact; SELECT uuid, nextVal('hs_office_contact_legacy_id_seq') FROM hs_office_contact;
--/ --/
@ -66,8 +66,8 @@ end; $$;
create trigger createContactLegacyIdMapping create trigger createContactLegacyIdMapping
after insert on hs_office_contact after insert on hs_office_contact
for each row for each row
execute procedure insertContactLegacyIdMapping(); execute procedure insertContactLegacyIdMapping();
--/ --/
@ -91,6 +91,6 @@ end; $$;
create trigger removeContactLegacyIdMapping create trigger removeContactLegacyIdMapping
before delete on hs_office_contact before delete on hs_office_contact
for each row for each row
execute procedure deleteContactLegacyIdMapping(); execute procedure deleteContactLegacyIdMapping();
--/ --/

View File

@ -41,7 +41,7 @@ ALTER TABLE hs_office_partner_legacy_id
CALL defineContext('schema-migration'); CALL defineContext('schema-migration');
INSERT INTO hs_office_partner_legacy_id(uuid, bp_id) INSERT INTO hs_office_partner_legacy_id(uuid, bp_id)
SELECT uuid, nextVal('hs_office_partner_legacy_id_seq') FROM hs_office_partner; SELECT uuid, nextVal('hs_office_partner_legacy_id_seq') FROM hs_office_partner;
--/ --/

View File

@ -43,7 +43,7 @@ ALTER TABLE hs_office_sepamandate_legacy_id
CALL defineContext('schema-migration'); CALL defineContext('schema-migration');
INSERT INTO hs_office_sepamandate_legacy_id(uuid, sepa_mandat_id) INSERT INTO hs_office_sepamandate_legacy_id(uuid, sepa_mandat_id)
SELECT uuid, nextVal('hs_office_sepamandate_legacy_id_seq') FROM hs_office_sepamandate; SELECT uuid, nextVal('hs_office_sepamandate_legacy_id_seq') FROM hs_office_sepamandate;
--/ --/
@ -67,8 +67,8 @@ end; $$;
create trigger createSepaMandateLegacyIdMapping create trigger createSepaMandateLegacyIdMapping
after insert on hs_office_sepamandate after insert on hs_office_sepamandate
for each row for each row
execute procedure insertSepaMandateLegacyIdMapping(); execute procedure insertSepaMandateLegacyIdMapping();
--/ --/
@ -92,6 +92,6 @@ end; $$;
create trigger removeSepaMandateLegacyIdMapping create trigger removeSepaMandateLegacyIdMapping
before delete on hs_office_sepamandate before delete on hs_office_sepamandate
for each row for each row
execute procedure deleteSepaMandateLegacyIdMapping(); execute procedure deleteSepaMandateLegacyIdMapping();
--/ --/

View File

@ -42,7 +42,7 @@ ALTER TABLE hs_office_coopsharestransaction_legacy_id
CALL defineContext('schema-migration'); CALL defineContext('schema-migration');
INSERT INTO hs_office_coopsharestransaction_legacy_id(uuid, member_share_id) INSERT INTO hs_office_coopsharestransaction_legacy_id(uuid, member_share_id)
SELECT uuid, nextVal('hs_office_coopsharestransaction_legacy_id_seq') FROM hs_office_coopsharestransaction; SELECT uuid, nextVal('hs_office_coopsharestransaction_legacy_id_seq') FROM hs_office_coopsharestransaction;
--/ --/
@ -66,8 +66,8 @@ end; $$;
create trigger createCoopSharesLegacyIdMapping create trigger createCoopSharesLegacyIdMapping
after insert on hs_office_coopsharestransaction after insert on hs_office_coopsharestransaction
for each row for each row
execute procedure insertCoopSharesLegacyIdMapping(); execute procedure insertCoopSharesLegacyIdMapping();
--/ --/
@ -91,6 +91,6 @@ end; $$;
create trigger removeCoopSharesLegacyIdMapping create trigger removeCoopSharesLegacyIdMapping
before delete on hs_office_coopsharestransaction before delete on hs_office_coopsharestransaction
for each row for each row
execute procedure deleteCoopSharesLegacyIdMapping(); execute procedure deleteCoopSharesLegacyIdMapping();
--/ --/

View File

@ -10,7 +10,7 @@
CREATE TABLE hs_office_coopassetstransaction_legacy_id CREATE TABLE hs_office_coopassetstransaction_legacy_id
( (
uuid uuid NOT NULL REFERENCES hs_office_coopassetstransaction(uuid), uuid uuid NOT NULL REFERENCES hs_office_coopassetstransaction(uuid),
member_asstr_id integer NOT NULL member_asset_id integer NOT NULL
); );
--// --//
@ -22,7 +22,7 @@ CREATE TABLE hs_office_coopassetstransaction_legacy_id
CREATE SEQUENCE IF NOT EXISTS hs_office_coopassetstransaction_legacy_id_seq CREATE SEQUENCE IF NOT EXISTS hs_office_coopassetstransaction_legacy_id_seq
AS integer AS integer
START 1000000000 START 1000000000
OWNED BY hs_office_coopassetstransaction_legacy_id.member_asstr_id; OWNED BY hs_office_coopassetstransaction_legacy_id.member_asset_id;
--// --//
@ -31,18 +31,18 @@ CREATE SEQUENCE IF NOT EXISTS hs_office_coopassetstransaction_legacy_id_seq
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
ALTER TABLE hs_office_coopassetstransaction_legacy_id ALTER TABLE hs_office_coopassetstransaction_legacy_id
ALTER COLUMN member_asstr_id ALTER COLUMN member_asset_id
SET DEFAULT nextVal('hs_office_coopassetstransaction_legacy_id_seq'); SET DEFAULT nextVal('hs_office_coopassetstransaction_legacy_id_seq');
--/ --/
-- ============================================================================ -- ============================================================================
--changeset hs-office-coopassets-MIGRATION-insert:1 endDelimiter:--// --changeset hs-office-coopassets-MIGRATION-insert:1 endDelimiter:--//
-- ---------------------------------------------------------------------------- -- ----------------------------------------------------------------------------
CALL defineContext('schema-migration'); CALL defineContext('schema-migration');
INSERT INTO hs_office_coopassetstransaction_legacy_id(uuid, member_asstr_id) INSERT INTO hs_office_coopassetstransaction_legacy_id(uuid, member_asset_id)
SELECT uuid, nextVal('hs_office_coopassetstransaction_legacy_id_seq') FROM hs_office_coopassetstransaction; SELECT uuid, nextVal('hs_office_coopassetstransaction_legacy_id_seq') FROM hs_office_coopassetstransaction;
--/ --/
@ -66,8 +66,8 @@ end; $$;
create trigger createCoopAssetsLegacyIdMapping create trigger createCoopAssetsLegacyIdMapping
after insert on hs_office_coopassetstransaction after insert on hs_office_coopassetstransaction
for each row for each row
execute procedure insertCoopAssetsLegacyIdMapping(); execute procedure insertCoopAssetsLegacyIdMapping();
--/ --/
@ -91,6 +91,6 @@ end; $$;
create trigger removeCoopAssetsLegacyIdMapping create trigger removeCoopAssetsLegacyIdMapping
before delete on hs_office_coopassetstransaction before delete on hs_office_coopassetstransaction
for each row for each row
execute procedure deleteCoopAssetsLegacyIdMapping(); execute procedure deleteCoopAssetsLegacyIdMapping();
--/ --/