move check-functions to module schemas

This commit is contained in:
Michael Hoennig 2024-09-20 08:51:42 +02:00
parent 7563f32215
commit bdf2ab6a24
3 changed files with 5 additions and 5 deletions

View File

@ -36,7 +36,7 @@ alter table hs_office.coopsharestransaction
--changeset michael.hoennig:hs-office-coopshares-SHARE-COUNT-CONSTRAINT endDelimiter:--//
-- ----------------------------------------------------------------------------
create or replace function checkSharesByMembershipUuid(forMembershipUuid UUID, newShareCount integer)
create or replace function hs_office.coopsharestx_check_positive_total(forMembershipUuid UUID, newShareCount integer)
returns boolean
language plpgsql as $$
declare
@ -56,7 +56,7 @@ end; $$;
alter table hs_office.coopsharestransaction
add constraint check_positive_total_shares_count
check ( checkSharesByMembershipUuid(membershipUuid, shareCount) );
check ( hs_office.coopsharestx_check_positive_total(membershipUuid, shareCount) );
--//

View File

@ -44,7 +44,7 @@ alter table hs_office.coopassetstransaction
--changeset michael.hoennig:hs-office-coopassets-ASSET-VALUE-CONSTRAINT endDelimiter:--//
-- ----------------------------------------------------------------------------
create or replace function checkAssetsByMembershipUuid(forMembershipUuid UUID, newAssetValue money)
create or replace function hs_office.coopassetstx_check_positive_total(forMembershipUuid UUID, newAssetValue money)
returns boolean
language plpgsql as $$
declare
@ -64,7 +64,7 @@ end; $$;
alter table hs_office.coopassetstransaction
add constraint check_positive_total
check ( checkAssetsByMembershipUuid(membershipUuid, assetValue) );
check ( hs_office.coopassetstx_check_positive_total(membershipUuid, assetValue) );
--//

View File

@ -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-local}
url: ${spring.datasource.url-tc}
username: postgres
password: password