From 7563f322151c6f15c1fc618103c78b0e347134a2 Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 20 Sep 2024 08:44:35 +0200 Subject: [PATCH] move legacy_id trigger-functions to module schema --- .../501-contact/5016-hs-office-contact-migration.sql | 12 ++++++------ .../504-partner/5046-hs-office-partner-migration.sql | 12 ++++++------ .../5076-hs-office-sepamandate-migration.sql | 12 ++++++------ .../5116-hs-office-coopshares-migration.sql | 12 ++++++------ .../5126-hs-office-coopassets-migration.sql | 12 ++++++------ .../7016-hs-hosting-asset-migration.sql | 12 ++++++------ src/test/resources/application.yml | 2 +- 7 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/main/resources/db/changelog/5-hs-office/501-contact/5016-hs-office-contact-migration.sql b/src/main/resources/db/changelog/5-hs-office/501-contact/5016-hs-office-contact-migration.sql index ae41ee0f..4e0683a8 100644 --- a/src/main/resources/db/changelog/5-hs-office/501-contact/5016-hs-office-contact-migration.sql +++ b/src/main/resources/db/changelog/5-hs-office/501-contact/5016-hs-office-contact-migration.sql @@ -49,7 +49,7 @@ INSERT INTO hs_office.contact_legacy_id(uuid, contact_id) -- ============================================================================ --changeset michael.hoennig:hs-office-contact-MIGRATION-insert-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function insertContactLegacyIdMapping() +create or replace function hs_office.contact_insert_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -64,17 +64,17 @@ begin return NEW; end; $$; -create trigger createContactLegacyIdMapping +create trigger insert_legacy_id_mapping_tg after insert on hs_office.contact for each row - execute procedure insertContactLegacyIdMapping(); + execute procedure hs_office.contact_insert_legacy_id_mapping_tf(); --/ -- ============================================================================ --changeset michael.hoennig:hs-office-contact-MIGRATION-delete-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function deleteContactLegacyIdMapping() +create or replace function hs_office.contact_delete_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -89,8 +89,8 @@ begin return OLD; end; $$; -create trigger removeContactLegacyIdMapping +create trigger delete_legacy_id_mapping_tf before delete on hs_office.contact for each row - execute procedure deleteContactLegacyIdMapping(); + execute procedure hs_office.contact_delete_legacy_id_mapping_tf(); --/ diff --git a/src/main/resources/db/changelog/5-hs-office/504-partner/5046-hs-office-partner-migration.sql b/src/main/resources/db/changelog/5-hs-office/504-partner/5046-hs-office-partner-migration.sql index 5e79ecf8..0a4da2cd 100644 --- a/src/main/resources/db/changelog/5-hs-office/504-partner/5046-hs-office-partner-migration.sql +++ b/src/main/resources/db/changelog/5-hs-office/504-partner/5046-hs-office-partner-migration.sql @@ -48,7 +48,7 @@ INSERT INTO hs_office.partner_legacy_id(uuid, bp_id) -- ============================================================================ --changeset michael.hoennig:hs-office-partner-MIGRATION-insert-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function insertPartnerLegacyIdMapping() +create or replace function hs_office.partner_insert_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -63,17 +63,17 @@ begin return NEW; end; $$; -create trigger createPartnerLegacyIdMapping +create trigger insert_legacy_id_mapping_tf after insert on hs_office.partner for each row - execute procedure insertPartnerLegacyIdMapping(); + execute procedure hs_office.partner_insert_legacy_id_mapping_tf(); --/ -- ============================================================================ --changeset michael.hoennig:hs-office-partner-MIGRATION-delete-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function deletePartnerLegacyIdMapping() +create or replace function hs_office.partner_delete_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -88,8 +88,8 @@ begin return OLD; end; $$; -create trigger removePartnerLegacyIdMapping +create trigger delete_legacy_id_mapping_tg before delete on hs_office.partner for each row - execute procedure deletePartnerLegacyIdMapping(); + execute procedure hs_office.partner_delete_legacy_id_mapping_tf(); --/ diff --git a/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5076-hs-office-sepamandate-migration.sql b/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5076-hs-office-sepamandate-migration.sql index 2446eff9..977bd8d0 100644 --- a/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5076-hs-office-sepamandate-migration.sql +++ b/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5076-hs-office-sepamandate-migration.sql @@ -50,7 +50,7 @@ INSERT INTO hs_office.sepamandate_legacy_id(uuid, sepa_mandate_id) -- ============================================================================ --changeset michael.hoennig:hs-office-sepamandate-MIGRATION-insert-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function insertSepaMandateLegacyIdMapping() +create or replace function hs_office.sepamandate_insert_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -65,17 +65,17 @@ begin return NEW; end; $$; -create trigger createSepaMandateLegacyIdMapping +create trigger insert_legacy_id_mapping_tg after insert on hs_office.sepamandate for each row - execute procedure insertSepaMandateLegacyIdMapping(); + execute procedure hs_office.sepamandate_insert_legacy_id_mapping_tf(); --/ -- ============================================================================ --changeset michael.hoennig:hs-office-sepamandate-MIGRATION-delete-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function deleteSepaMandateLegacyIdMapping() +create or replace function hs_office.sepamandate_delete_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -90,8 +90,8 @@ begin return OLD; end; $$; -create trigger removeSepaMandateLegacyIdMapping +create trigger delete_legacy_id_mapping_tf before delete on hs_office.sepamandate for each row - execute procedure deleteSepaMandateLegacyIdMapping(); + execute procedure hs_office.sepamandate_delete_legacy_id_mapping_tf(); --/ diff --git a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5116-hs-office-coopshares-migration.sql b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5116-hs-office-coopshares-migration.sql index 40912e0c..1aaf2f0a 100644 --- a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5116-hs-office-coopshares-migration.sql +++ b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5116-hs-office-coopshares-migration.sql @@ -49,7 +49,7 @@ INSERT INTO hs_office.coopsharestransaction_legacy_id(uuid, member_share_id) -- ============================================================================ --changeset michael.hoennig:hs-office-coopShares-MIGRATION-insert-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function insertCoopSharesLegacyIdMapping() +create or replace function hs_office.coopsharetx_insert_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -64,17 +64,17 @@ begin return NEW; end; $$; -create trigger createCoopSharesLegacyIdMapping +create trigger insert_legacy_id_mapping_tg after insert on hs_office.coopsharestransaction for each row - execute procedure insertCoopSharesLegacyIdMapping(); + execute procedure hs_office.coopsharetx_insert_legacy_id_mapping_tf(); --/ -- ============================================================================ --changeset michael.hoennig:hs-office-coopShares-MIGRATION-delete-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function deleteCoopSharesLegacyIdMapping() +create or replace function hs_office.coopsharetx_delete_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -89,8 +89,8 @@ begin return OLD; end; $$; -create trigger removeCoopSharesLegacyIdMapping +create trigger delete_legacy_id_mapping_tg before delete on hs_office.coopsharestransaction for each row - execute procedure deleteCoopSharesLegacyIdMapping(); + execute procedure hs_office.coopsharetx_delete_legacy_id_mapping_tf(); --/ diff --git a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5126-hs-office-coopassets-migration.sql b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5126-hs-office-coopassets-migration.sql index 3919b13c..841ca6e6 100644 --- a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5126-hs-office-coopassets-migration.sql +++ b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5126-hs-office-coopassets-migration.sql @@ -49,7 +49,7 @@ INSERT INTO hs_office.coopassetstransaction_legacy_id(uuid, member_asset_id) -- ============================================================================ --changeset michael.hoennig:hs-office-coopAssets-MIGRATION-insert-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function insertCoopAssetsLegacyIdMapping() +create or replace function hs_office.coopassettx_insert_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -64,17 +64,17 @@ begin return NEW; end; $$; -create trigger createCoopAssetsLegacyIdMapping +create trigger insert_legacy_id_mapping_tg after insert on hs_office.coopassetstransaction for each row - execute procedure insertCoopAssetsLegacyIdMapping(); + execute procedure hs_office.coopassettx_insert_legacy_id_mapping_tf(); --/ -- ============================================================================ --changeset michael.hoennig:hs-office-coopAssets-MIGRATION-delete-trigger endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function deleteCoopAssetsLegacyIdMapping() +create or replace function hs_office.coopassettx_delete_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -89,8 +89,8 @@ begin return OLD; end; $$; -create trigger removeCoopAssetsLegacyIdMapping +create trigger delete_legacy_id_mapping_tg before delete on hs_office.coopassetstransaction for each row - execute procedure deleteCoopAssetsLegacyIdMapping(); + execute procedure hs_office.coopassettx_delete_legacy_id_mapping_tf(); --/ diff --git a/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7016-hs-hosting-asset-migration.sql b/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7016-hs-hosting-asset-migration.sql index 1aff9f5e..b6edea34 100644 --- a/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7016-hs-hosting-asset-migration.sql +++ b/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7016-hs-hosting-asset-migration.sql @@ -49,7 +49,7 @@ INSERT INTO hs_hosting.asset_legacy_id(uuid, legacy_id) -- ============================================================================ --changeset hs-hosting-asset-MIGRATION-insert-trigger:1 endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function insertassetLegacyIdMapping() +create or replace function hs_hosting.asset_insert_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -64,17 +64,17 @@ begin return NEW; end; $$; -create trigger createassetLegacyIdMapping +create trigger insert_legacy_id_mapping_tg after insert on hs_hosting.asset for each row - execute procedure insertassetLegacyIdMapping(); + execute procedure hs_hosting.asset_insert_legacy_id_mapping_tf(); --/ -- ============================================================================ --changeset hs-hosting-asset-MIGRATION-delete-trigger:1 endDelimiter:--// -- ---------------------------------------------------------------------------- -create or replace function deleteassetLegacyIdMapping_tf() +create or replace function hs_hosting.asset_delete_legacy_id_mapping_tf() returns trigger language plpgsql strict as $$ @@ -89,8 +89,8 @@ begin return OLD; end; $$; -create trigger deleteassetLegacyIdMapping_tg +create trigger delete_legacy_id_mapping_tg before delete on hs_hosting.asset for each row - execute procedure deleteassetLegacyIdMapping_tf(); + execute procedure hs_hosting.asset_delete_legacy_id_mapping_tf(); --/ diff --git a/src/test/resources/application.yml b/src/test/resources/application.yml index 923c62e9..b4945a0f 100644 --- a/src/test/resources/application.yml +++ b/src/test/resources/application.yml @@ -7,7 +7,7 @@ spring: url-tc: jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers url-tcx: jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers?TC_REUSABLE=true&TC_DAEMON=true url-local: jdbc:postgresql://localhost:5432/postgres - url: ${spring.datasource.url-tc} + url: ${spring.datasource.url-local} username: postgres password: password