move check-functions to module schemas
This commit is contained in:
parent
7563f32215
commit
bdf2ab6a24
@ -36,7 +36,7 @@ alter table hs_office.coopsharestransaction
|
|||||||
--changeset michael.hoennig:hs-office-coopshares-SHARE-COUNT-CONSTRAINT endDelimiter:--//
|
--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
|
returns boolean
|
||||||
language plpgsql as $$
|
language plpgsql as $$
|
||||||
declare
|
declare
|
||||||
@ -56,7 +56,7 @@ end; $$;
|
|||||||
|
|
||||||
alter table hs_office.coopsharestransaction
|
alter table hs_office.coopsharestransaction
|
||||||
add constraint check_positive_total_shares_count
|
add constraint check_positive_total_shares_count
|
||||||
check ( checkSharesByMembershipUuid(membershipUuid, shareCount) );
|
check ( hs_office.coopsharestx_check_positive_total(membershipUuid, shareCount) );
|
||||||
|
|
||||||
--//
|
--//
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ alter table hs_office.coopassetstransaction
|
|||||||
--changeset michael.hoennig:hs-office-coopassets-ASSET-VALUE-CONSTRAINT endDelimiter:--//
|
--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
|
returns boolean
|
||||||
language plpgsql as $$
|
language plpgsql as $$
|
||||||
declare
|
declare
|
||||||
@ -64,7 +64,7 @@ end; $$;
|
|||||||
|
|
||||||
alter table hs_office.coopassetstransaction
|
alter table hs_office.coopassetstransaction
|
||||||
add constraint check_positive_total
|
add constraint check_positive_total
|
||||||
check ( checkAssetsByMembershipUuid(membershipUuid, assetValue) );
|
check ( hs_office.coopassetstx_check_positive_total(membershipUuid, assetValue) );
|
||||||
--//
|
--//
|
||||||
|
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@ spring:
|
|||||||
url-tc: jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers
|
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-tcx: jdbc:tc:postgresql:15.5-bookworm:///spring_boot_testcontainers?TC_REUSABLE=true&TC_DAEMON=true
|
||||||
url-local: jdbc:postgresql://localhost:5432/postgres
|
url-local: jdbc:postgresql://localhost:5432/postgres
|
||||||
url: ${spring.datasource.url-local}
|
url: ${spring.datasource.url-tc}
|
||||||
username: postgres
|
username: postgres
|
||||||
password: password
|
password: password
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user