From a0e1d9627876e758ba50c69edceea4845876dc4c Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Wed, 18 Sep 2024 15:04:21 +0200 Subject: [PATCH] move test-data-creation to separate schemas --- .../2018-rbactest-customer-test-data.sql | 14 ++++----- .../2028-rbactest-package-test-data.sql | 12 ++++---- .../2038-rbactest-domain-test-data.sql | 26 ++++++++-------- .../5018-hs-office-contact-test-data.sql | 30 +++++++++---------- .../502-person/5020-hs-office-person.sql | 6 ++-- .../5028-hs-office-person-test-data.sql | 2 +- .../503-relation/5030-hs-office-relation.sql | 6 ++-- .../5038-hs-office-relation-test-data.sql | 2 +- .../5048-hs-office-partner-test-data.sql | 12 ++++---- .../5058-hs-office-bankaccount-test-data.sql | 18 +++++------ .../5068-hs-office-debitor-test-data.sql | 8 ++--- .../5078-hs-office-sepamandate-test-data.sql | 8 ++--- .../5100-hs-office-membership.sql | 6 ++-- .../5108-hs-office-membership-test-data.sql | 8 ++--- .../5110-hs-office-coopshares.sql | 6 ++-- .../5118-hs-office-coopshares-test-data.sql | 8 ++--- .../5120-hs-office-coopassets.sql | 6 ++-- .../5128-hs-office-coopassets-test-data.sql | 8 ++--- .../6308-hs-booking-item-test-data.sql | 8 ++--- .../7018-hs-hosting-asset-test-data.sql | 8 ++--- 20 files changed, 100 insertions(+), 102 deletions(-) diff --git a/src/main/resources/db/changelog/2-rbactest/201-rbactest-customer/2018-rbactest-customer-test-data.sql b/src/main/resources/db/changelog/2-rbactest/201-rbactest-customer/2018-rbactest-customer-test-data.sql index f441522e..af57b169 100644 --- a/src/main/resources/db/changelog/2-rbactest/201-rbactest-customer/2018-rbactest-customer-test-data.sql +++ b/src/main/resources/db/changelog/2-rbactest/201-rbactest-customer/2018-rbactest-customer-test-data.sql @@ -7,7 +7,7 @@ /* Generates a customer reference number for a given test data counter. */ -create or replace function testCustomerReference(customerCount integer) +create or replace function rbactest.testCustomerReference(customerCount integer) returns integer returns null on null input language plpgsql as $$ @@ -19,7 +19,7 @@ end; $$; /* Creates a single customer test record with dist. */ -create or replace procedure createTestCustomerTestData( +create or replace procedure rbactest.createTestCustomerTestData( custReference integer, custPrefix varchar ) @@ -51,7 +51,7 @@ end; $$; /* Creates a range of test customers for mass data generation. */ -create or replace procedure createTestCustomerTestData( +create or replace procedure rbactest.createTestCustomerTestData( startCount integer, -- count of auto generated rows before the run endCount integer -- count of auto generated rows after the run ) @@ -59,7 +59,7 @@ create or replace procedure createTestCustomerTestData( begin for t in startCount..endCount loop - call createTestCustomerTestData(testCustomerReference(t), base.intToVarChar(t, 3)); + call rbactest.createTestCustomerTestData(rbactest.testCustomerReference(t), base.intToVarChar(t, 3)); commit; end loop; end; $$; @@ -74,9 +74,9 @@ do language plpgsql $$ begin call base.defineContext('creating RBAC test customer', null, 'superuser-alex@hostsharing.net', 'rbac.global#global:ADMIN'); - call createTestCustomerTestData(99901, 'xxx'); - call createTestCustomerTestData(99902, 'yyy'); - call createTestCustomerTestData(99903, 'zzz'); + call rbactest.createTestCustomerTestData(99901, 'xxx'); + call rbactest.createTestCustomerTestData(99902, 'yyy'); + call rbactest.createTestCustomerTestData(99903, 'zzz'); end; $$; --// diff --git a/src/main/resources/db/changelog/2-rbactest/202-rbactest-package/2028-rbactest-package-test-data.sql b/src/main/resources/db/changelog/2-rbactest/202-rbactest-package/2028-rbactest-package-test-data.sql index 869b9cb4..4b227df2 100644 --- a/src/main/resources/db/changelog/2-rbactest/202-rbactest-package/2028-rbactest-package-test-data.sql +++ b/src/main/resources/db/changelog/2-rbactest/202-rbactest-package/2028-rbactest-package-test-data.sql @@ -6,7 +6,7 @@ /* Creates the given number of test packages for the given customer. */ -create or replace procedure createPackageTestData(customerPrefix varchar, pacCount int) +create or replace procedure rbactest.createPackageTestData(customerPrefix varchar, pacCount int) language plpgsql as $$ declare cust rbactest.customer; @@ -41,7 +41,7 @@ end; $$; /* Creates a range of test packages for mass data generation. */ -create or replace procedure createPackageTestData() +create or replace procedure rbactest.createPackageTestData() language plpgsql as $$ declare cust rbactest.customer; @@ -49,7 +49,7 @@ begin for cust in (select * from rbactest.customer) loop continue when cust.reference >= 90000; -- reserved for functional testing - call createPackageTestData(cust.prefix, 3); + call rbactest.createPackageTestData(cust.prefix, 3); end loop; commit; @@ -64,9 +64,9 @@ $$; do language plpgsql $$ begin - call createPackageTestData('xxx', 3); - call createPackageTestData('yyy', 3); - call createPackageTestData('zzz', 3); + call rbactest.createPackageTestData('xxx', 3); + call rbactest.createPackageTestData('yyy', 3); + call rbactest.createPackageTestData('zzz', 3); end; $$; --// diff --git a/src/main/resources/db/changelog/2-rbactest/203-rbactest-domain/2038-rbactest-domain-test-data.sql b/src/main/resources/db/changelog/2-rbactest/203-rbactest-domain/2038-rbactest-domain-test-data.sql index 38843d1e..23ce972c 100644 --- a/src/main/resources/db/changelog/2-rbactest/203-rbactest-domain/2038-rbactest-domain-test-data.sql +++ b/src/main/resources/db/changelog/2-rbactest/203-rbactest-domain/2038-rbactest-domain-test-data.sql @@ -6,7 +6,7 @@ /* Creates the given count of test unix users for a single package. */ -create or replace procedure createdomainTestData( packageName varchar, domainCount int ) +create or replace procedure rbactest.createDomainTestData( packageName varchar, domainCount int ) language plpgsql as $$ declare pac record; @@ -32,12 +32,10 @@ end; $$; /* Creates a range of unix users for mass data generation. */ -create or replace procedure createdomainTestData( domainPerPackage integer ) +create or replace procedure rbactest.createDomainTestData( domainPerPackage integer ) language plpgsql as $$ declare pac record; - pacAdmin varchar; - currentTask varchar; begin for pac in (select p.uuid, p.name @@ -45,7 +43,7 @@ begin join rbactest.customer c on p.customeruuid = c.uuid where c.reference < 90000) -- reserved for functional testing loop - call createdomainTestData(pac.name, 2); + call rbactest.createdomainTestData(pac.name, 2); commit; end loop; @@ -59,17 +57,17 @@ end; $$; do language plpgsql $$ begin - call createdomainTestData('xxx00', 2); - call createdomainTestData('xxx01', 2); - call createdomainTestData('xxx02', 2); + call rbactest.createDomainTestData('xxx00', 2); + call rbactest.createDomainTestData('xxx01', 2); + call rbactest.createDomainTestData('xxx02', 2); - call createdomainTestData('yyy00', 2); - call createdomainTestData('yyy01', 2); - call createdomainTestData('yyy02', 2); + call rbactest.createDomainTestData('yyy00', 2); + call rbactest.createDomainTestData('yyy01', 2); + call rbactest.createDomainTestData('yyy02', 2); - call createdomainTestData('zzz00', 2); - call createdomainTestData('zzz01', 2); - call createdomainTestData('zzz02', 2); + call rbactest.createDomainTestData('zzz00', 2); + call rbactest.createDomainTestData('zzz01', 2); + call rbactest.createDomainTestData('zzz02', 2); end; $$; --// diff --git a/src/main/resources/db/changelog/5-hs-office/501-contact/5018-hs-office-contact-test-data.sql b/src/main/resources/db/changelog/5-hs-office/501-contact/5018-hs-office-contact-test-data.sql index 40f9e065..5acd8e4f 100644 --- a/src/main/resources/db/changelog/5-hs-office/501-contact/5018-hs-office-contact-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/501-contact/5018-hs-office-contact-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single contact test record. */ -create or replace procedure createHsOfficeContactTestData(contCaption varchar) +create or replace procedure hs_office.createHsOfficeContactTestData(contCaption varchar) language plpgsql as $$ declare postalAddr varchar; @@ -36,7 +36,7 @@ end; $$; /* Creates a range of test contact for mass data generation. */ -create or replace procedure createHsOfficeContactTestData( +create or replace procedure hs_office.createHsOfficeContactTestData( startCount integer, -- count of auto generated rows before the run endCount integer -- count of auto generated rows after the run ) @@ -44,7 +44,7 @@ create or replace procedure createHsOfficeContactTestData( begin for t in startCount..endCount loop - call createHsOfficeContactTestData(base.intToVarChar(t, 4) || '#' || t); + call hs_office.createHsOfficeContactTestData(base.intToVarChar(t, 4) || '#' || t); commit; end loop; end; $$; @@ -58,18 +58,18 @@ end; $$; do language plpgsql $$ begin -- TODO: use better names - call createHsOfficeContactTestData('first contact'); - call createHsOfficeContactTestData('second contact'); - call createHsOfficeContactTestData('third contact'); - call createHsOfficeContactTestData('fourth contact'); - call createHsOfficeContactTestData('fifth contact'); - call createHsOfficeContactTestData('sixth contact'); - call createHsOfficeContactTestData('seventh contact'); - call createHsOfficeContactTestData('eighth contact'); - call createHsOfficeContactTestData('ninth contact'); - call createHsOfficeContactTestData('tenth contact'); - call createHsOfficeContactTestData('eleventh contact'); - call createHsOfficeContactTestData('twelfth contact'); + call hs_office.createHsOfficeContactTestData('first contact'); + call hs_office.createHsOfficeContactTestData('second contact'); + call hs_office.createHsOfficeContactTestData('third contact'); + call hs_office.createHsOfficeContactTestData('fourth contact'); + call hs_office.createHsOfficeContactTestData('fifth contact'); + call hs_office.createHsOfficeContactTestData('sixth contact'); + call hs_office.createHsOfficeContactTestData('seventh contact'); + call hs_office.createHsOfficeContactTestData('eighth contact'); + call hs_office.createHsOfficeContactTestData('ninth contact'); + call hs_office.createHsOfficeContactTestData('tenth contact'); + call hs_office.createHsOfficeContactTestData('eleventh contact'); + call hs_office.createHsOfficeContactTestData('twelfth contact'); end; $$; --// diff --git a/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql b/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql index 428df466..81245561 100644 --- a/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql +++ b/src/main/resources/db/changelog/5-hs-office/502-person/5020-hs-office-person.sql @@ -4,7 +4,7 @@ --changeset michael.hoennig:hs-office-person-MAIN-TABLE endDelimiter:--// -- ---------------------------------------------------------------------------- -CREATE TYPE HsOfficePersonType AS ENUM ( +CREATE TYPE hs_office.HsOfficePersonType AS ENUM ( '??', -- unknown 'NP', -- natural person 'LP', -- legal person @@ -12,13 +12,13 @@ CREATE TYPE HsOfficePersonType AS ENUM ( 'UF', -- unincorporated firm 'PI'); -- public institution -CREATE CAST (character varying as HsOfficePersonType) WITH INOUT AS IMPLICIT; +CREATE CAST (character varying as hs_office.HsOfficePersonType) WITH INOUT AS IMPLICIT; create table if not exists hs_office.person ( uuid uuid unique references rbac.object (uuid) initially deferred, version int not null default 0, - personType HsOfficePersonType not null, + personType hs_office.HsOfficePersonType not null, tradeName varchar(96), salutation varchar(30), title varchar(20), diff --git a/src/main/resources/db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data.sql b/src/main/resources/db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data.sql index 9ba8dd37..ae02d0d3 100644 --- a/src/main/resources/db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/502-person/5028-hs-office-person-test-data.sql @@ -9,7 +9,7 @@ Creates a single person test record. */ create or replace procedure createHsOfficePersonTestData( - newPersonType HsOfficePersonType, + newPersonType hs_office.HsOfficePersonType, newTradeName varchar, newFamilyName varchar = null, newGivenName varchar = null diff --git a/src/main/resources/db/changelog/5-hs-office/503-relation/5030-hs-office-relation.sql b/src/main/resources/db/changelog/5-hs-office/503-relation/5030-hs-office-relation.sql index 1c17aa78..8c946f66 100644 --- a/src/main/resources/db/changelog/5-hs-office/503-relation/5030-hs-office-relation.sql +++ b/src/main/resources/db/changelog/5-hs-office/503-relation/5030-hs-office-relation.sql @@ -4,7 +4,7 @@ --changeset michael.hoennig:hs-office-relation-MAIN-TABLE endDelimiter:--// -- ---------------------------------------------------------------------------- -CREATE TYPE HsOfficeRelationType AS ENUM ( +CREATE TYPE hs_office.HsOfficeRelationType AS ENUM ( 'UNKNOWN', 'PARTNER', 'EX_PARTNER', @@ -14,7 +14,7 @@ CREATE TYPE HsOfficeRelationType AS ENUM ( 'OPERATIONS', 'SUBSCRIBER'); -CREATE CAST (character varying as HsOfficeRelationType) WITH INOUT AS IMPLICIT; +CREATE CAST (character varying as hs_office.HsOfficeRelationType) WITH INOUT AS IMPLICIT; create table if not exists hs_office.relation ( @@ -23,7 +23,7 @@ create table if not exists hs_office.relation anchorUuid uuid not null references hs_office.person(uuid), holderUuid uuid not null references hs_office.person(uuid), contactUuid uuid references hs_office.contact(uuid), - type HsOfficeRelationType not null, + type hs_office.HsOfficeRelationType not null, mark varchar(24) ); --// diff --git a/src/main/resources/db/changelog/5-hs-office/503-relation/5038-hs-office-relation-test-data.sql b/src/main/resources/db/changelog/5-hs-office/503-relation/5038-hs-office-relation-test-data.sql index 3cb64e13..0de446e8 100644 --- a/src/main/resources/db/changelog/5-hs-office/503-relation/5038-hs-office-relation-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/503-relation/5038-hs-office-relation-test-data.sql @@ -10,7 +10,7 @@ */ create or replace procedure createHsOfficeRelationTestData( holderPersonName varchar, - relationType HsOfficeRelationType, + relationType hs_office.HsOfficeRelationType, anchorPersonName varchar, contactCaption varchar, mark varchar default null) diff --git a/src/main/resources/db/changelog/5-hs-office/504-partner/5048-hs-office-partner-test-data.sql b/src/main/resources/db/changelog/5-hs-office/504-partner/5048-hs-office-partner-test-data.sql index 114158c5..f8239efc 100644 --- a/src/main/resources/db/changelog/5-hs-office/504-partner/5048-hs-office-partner-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/504-partner/5048-hs-office-partner-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single partner test record. */ -create or replace procedure createHsOfficePartnerTestData( +create or replace procedure hs_office.createHsOfficePartnerTestData( mandantTradeName varchar, newPartnerNumber numeric(5), partnerPersonName varchar, @@ -73,11 +73,11 @@ do language plpgsql $$ begin call base.defineContext('creating partner test-data ', null, 'superuser-alex@hostsharing.net', 'rbac.global#global:ADMIN'); - call createHsOfficePartnerTestData('Hostsharing eG', 10001, 'First GmbH', 'first contact'); - call createHsOfficePartnerTestData('Hostsharing eG', 10002, 'Second e.K.', 'second contact'); - call createHsOfficePartnerTestData('Hostsharing eG', 10003, 'Third OHG', 'third contact'); - call createHsOfficePartnerTestData('Hostsharing eG', 10004, 'Fourth eG', 'fourth contact'); - call createHsOfficePartnerTestData('Hostsharing eG', 10010, 'Smith', 'fifth contact'); + call hs_office.createHsOfficePartnerTestData('Hostsharing eG', 10001, 'First GmbH', 'first contact'); + call hs_office.createHsOfficePartnerTestData('Hostsharing eG', 10002, 'Second e.K.', 'second contact'); + call hs_office.createHsOfficePartnerTestData('Hostsharing eG', 10003, 'Third OHG', 'third contact'); + call hs_office.createHsOfficePartnerTestData('Hostsharing eG', 10004, 'Fourth eG', 'fourth contact'); + call hs_office.createHsOfficePartnerTestData('Hostsharing eG', 10010, 'Smith', 'fifth contact'); end; $$; --// diff --git a/src/main/resources/db/changelog/5-hs-office/505-bankaccount/5058-hs-office-bankaccount-test-data.sql b/src/main/resources/db/changelog/5-hs-office/505-bankaccount/5058-hs-office-bankaccount-test-data.sql index 0a8123eb..f8233c48 100644 --- a/src/main/resources/db/changelog/5-hs-office/505-bankaccount/5058-hs-office-bankaccount-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/505-bankaccount/5058-hs-office-bankaccount-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single bankaccount test record. */ -create or replace procedure createHsOfficeBankAccountTestData(givenHolder varchar, givenIBAN varchar, givenBIC varchar) +create or replace procedure hs_office.createHsOfficeBankAccountTestData(givenHolder varchar, givenIBAN varchar, givenBIC varchar) language plpgsql as $$ declare emailAddr varchar; @@ -34,13 +34,13 @@ do language plpgsql $$ call base.defineContext('creating bankaccount test-data'); -- IBANs+BICs taken from https://ibanvalidieren.de/beispiele.html - call createHsOfficeBankAccountTestData('First GmbH', 'DE02120300000000202051', 'BYLADEM1001'); - call createHsOfficeBankAccountTestData('Peter Smith', 'DE02500105170137075030', 'INGDDEFF'); - call createHsOfficeBankAccountTestData('Second e.K.', 'DE02100500000054540402', 'BELADEBE'); - call createHsOfficeBankAccountTestData('Third OHG', 'DE02300209000106531065', 'CMCIDEDD'); - call createHsOfficeBankAccountTestData('Fourth eG', 'DE02200505501015871393', 'HASPDEHH'); - call createHsOfficeBankAccountTestData('Mel Bessler', 'DE02100100100006820101', 'PBNKDEFF'); - call createHsOfficeBankAccountTestData('Anita Bessler', 'DE02300606010002474689', 'DAAEDEDD'); - call createHsOfficeBankAccountTestData('Paul Winkler', 'DE02600501010002034304', 'SOLADEST600'); + call hs_office.createHsOfficeBankAccountTestData('First GmbH', 'DE02120300000000202051', 'BYLADEM1001'); + call hs_office.createHsOfficeBankAccountTestData('Peter Smith', 'DE02500105170137075030', 'INGDDEFF'); + call hs_office.createHsOfficeBankAccountTestData('Second e.K.', 'DE02100500000054540402', 'BELADEBE'); + call hs_office.createHsOfficeBankAccountTestData('Third OHG', 'DE02300209000106531065', 'CMCIDEDD'); + call hs_office.createHsOfficeBankAccountTestData('Fourth eG', 'DE02200505501015871393', 'HASPDEHH'); + call hs_office.createHsOfficeBankAccountTestData('Mel Bessler', 'DE02100100100006820101', 'PBNKDEFF'); + call hs_office.createHsOfficeBankAccountTestData('Anita Bessler', 'DE02300606010002474689', 'DAAEDEDD'); + call hs_office.createHsOfficeBankAccountTestData('Paul Winkler', 'DE02600501010002034304', 'SOLADEST600'); end; $$; diff --git a/src/main/resources/db/changelog/5-hs-office/506-debitor/5068-hs-office-debitor-test-data.sql b/src/main/resources/db/changelog/5-hs-office/506-debitor/5068-hs-office-debitor-test-data.sql index df82033d..db4bc66e 100644 --- a/src/main/resources/db/changelog/5-hs-office/506-debitor/5068-hs-office-debitor-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/506-debitor/5068-hs-office-debitor-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single debitor test record. */ -create or replace procedure createHsOfficeDebitorTestData( +create or replace procedure hs_office.createHsOfficeDebitorTestData( withDebitorNumberSuffix numeric(5), forPartnerPersonName varchar, forBillingContactCaption varchar, @@ -52,9 +52,9 @@ do language plpgsql $$ begin call base.defineContext('creating debitor test-data', null, 'superuser-alex@hostsharing.net', 'rbac.global#global:ADMIN'); - call createHsOfficeDebitorTestData(11, 'First GmbH', 'first contact', 'fir'); - call createHsOfficeDebitorTestData(12, 'Second e.K.', 'second contact', 'sec'); - call createHsOfficeDebitorTestData(13, 'Third OHG', 'third contact', 'thi'); + call hs_office.createHsOfficeDebitorTestData(11, 'First GmbH', 'first contact', 'fir'); + call hs_office.createHsOfficeDebitorTestData(12, 'Second e.K.', 'second contact', 'sec'); + call hs_office.createHsOfficeDebitorTestData(13, 'Third OHG', 'third contact', 'thi'); end; $$; --// diff --git a/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5078-hs-office-sepamandate-test-data.sql b/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5078-hs-office-sepamandate-test-data.sql index 51e33f6b..2de78d7a 100644 --- a/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5078-hs-office-sepamandate-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/507-sepamandate/5078-hs-office-sepamandate-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single sepaMandate test record. */ -create or replace procedure createHsOfficeSepaMandateTestData( +create or replace procedure hs_office.createHsOfficeSepaMandateTestData( forPartnerNumber numeric(5), forDebitorSuffix char(2), forIban varchar, @@ -45,9 +45,9 @@ do language plpgsql $$ begin call base.defineContext('creating SEPA-mandate test-data', null, 'superuser-alex@hostsharing.net', 'rbac.global#global:ADMIN'); - call createHsOfficeSepaMandateTestData(10001, '11', 'DE02120300000000202051', 'ref-10001-11'); - call createHsOfficeSepaMandateTestData(10002, '12', 'DE02100500000054540402', 'ref-10002-12'); - call createHsOfficeSepaMandateTestData(10003, '13', 'DE02300209000106531065', 'ref-10003-13'); + call hs_office.createHsOfficeSepaMandateTestData(10001, '11', 'DE02120300000000202051', 'ref-10001-11'); + call hs_office.createHsOfficeSepaMandateTestData(10002, '12', 'DE02100500000054540402', 'ref-10002-12'); + call hs_office.createHsOfficeSepaMandateTestData(10003, '13', 'DE02300209000106531065', 'ref-10003-13'); end; $$; --// diff --git a/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql b/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql index e0147e5a..d8d64559 100644 --- a/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql +++ b/src/main/resources/db/changelog/5-hs-office/510-membership/5100-hs-office-membership.sql @@ -4,7 +4,7 @@ --changeset michael.hoennig:hs-office-membership-MAIN-TABLE endDelimiter:--// -- ---------------------------------------------------------------------------- -CREATE TYPE HsOfficeMembershipStatus AS ENUM ( +CREATE TYPE hs_office.HsOfficeMembershipStatus AS ENUM ( 'INVALID', 'ACTIVE', 'CANCELLED', @@ -15,7 +15,7 @@ CREATE TYPE HsOfficeMembershipStatus AS ENUM ( 'UNKNOWN' ); -CREATE CAST (character varying as HsOfficeMembershipStatus) WITH INOUT AS IMPLICIT; +CREATE CAST (character varying as hs_office.HsOfficeMembershipStatus) WITH INOUT AS IMPLICIT; create table if not exists hs_office.membership ( @@ -24,7 +24,7 @@ create table if not exists hs_office.membership partnerUuid uuid not null references hs_office.partner(uuid), memberNumberSuffix char(2) not null check (memberNumberSuffix::text ~ '^[0-9][0-9]$'), validity daterange not null, - status HsOfficeMembershipStatus not null default 'ACTIVE', + status hs_office.HsOfficeMembershipStatus not null default 'ACTIVE', membershipFeeBillable boolean not null default true, UNIQUE(partnerUuid, memberNumberSuffix) diff --git a/src/main/resources/db/changelog/5-hs-office/510-membership/5108-hs-office-membership-test-data.sql b/src/main/resources/db/changelog/5-hs-office/510-membership/5108-hs-office-membership-test-data.sql index 8b904d6d..34cb07d5 100644 --- a/src/main/resources/db/changelog/5-hs-office/510-membership/5108-hs-office-membership-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/510-membership/5108-hs-office-membership-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single membership test record. */ -create or replace procedure createHsOfficeMembershipTestData( +create or replace procedure hs_office.createHsOfficeMembershipTestData( forPartnerNumber numeric(5), newMemberNumberSuffix char(2) ) language plpgsql as $$ @@ -35,9 +35,9 @@ do language plpgsql $$ begin call base.defineContext('creating Membership test-data', null, 'superuser-alex@hostsharing.net', 'rbac.global#global:ADMIN'); - call createHsOfficeMembershipTestData(10001, '01'); - call createHsOfficeMembershipTestData(10002, '02'); - call createHsOfficeMembershipTestData(10003, '03'); + call hs_office.createHsOfficeMembershipTestData(10001, '01'); + call hs_office.createHsOfficeMembershipTestData(10002, '02'); + call hs_office.createHsOfficeMembershipTestData(10003, '03'); end; $$; --// diff --git a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql index 7e15a874..5cf3ef82 100644 --- a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql +++ b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5110-hs-office-coopshares.sql @@ -4,16 +4,16 @@ --changeset michael.hoennig:hs-office-coopshares-MAIN-TABLE endDelimiter:--// -- ---------------------------------------------------------------------------- -CREATE TYPE HsOfficeCoopSharesTransactionType AS ENUM ('ADJUSTMENT', 'SUBSCRIPTION', 'CANCELLATION'); +CREATE TYPE hs_office.HsOfficeCoopSharesTransactionType AS ENUM ('ADJUSTMENT', 'SUBSCRIPTION', 'CANCELLATION'); -CREATE CAST (character varying as HsOfficeCoopSharesTransactionType) WITH INOUT AS IMPLICIT; +CREATE CAST (character varying as hs_office.HsOfficeCoopSharesTransactionType) WITH INOUT AS IMPLICIT; create table if not exists hs_office.coopsharestransaction ( uuid uuid unique references rbac.object (uuid) initially deferred, version int not null default 0, membershipUuid uuid not null references hs_office.membership(uuid), - transactionType HsOfficeCoopSharesTransactionType not null, + transactionType hs_office.HsOfficeCoopSharesTransactionType not null, valueDate date not null, shareCount integer not null, reference varchar(48) not null, diff --git a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5118-hs-office-coopshares-test-data.sql b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5118-hs-office-coopshares-test-data.sql index a4c634a7..bfddf0c7 100644 --- a/src/main/resources/db/changelog/5-hs-office/511-coopshares/5118-hs-office-coopshares-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/511-coopshares/5118-hs-office-coopshares-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single coopSharesTransaction test record. */ -create or replace procedure createHsOfficeCoopSharesTransactionTestData( +create or replace procedure hs_office.createHsOfficeCoopSharesTransactionTestData( givenPartnerNumber numeric, givenMemberNumberSuffix char(2) ) @@ -46,8 +46,8 @@ do language plpgsql $$ call base.defineContext('creating coopSharesTransaction test-data'); SET CONSTRAINTS ALL DEFERRED; - call createHsOfficeCoopSharesTransactionTestData(10001, '01'); - call createHsOfficeCoopSharesTransactionTestData(10002, '02'); - call createHsOfficeCoopSharesTransactionTestData(10003, '03'); + call hs_office.createHsOfficeCoopSharesTransactionTestData(10001, '01'); + call hs_office.createHsOfficeCoopSharesTransactionTestData(10002, '02'); + call hs_office.createHsOfficeCoopSharesTransactionTestData(10003, '03'); end; $$; diff --git a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql index 4804f4d7..4da4e0bd 100644 --- a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql +++ b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5120-hs-office-coopassets.sql @@ -4,7 +4,7 @@ --changeset michael.hoennig:hs-office-coopassets-MAIN-TABLE endDelimiter:--// -- ---------------------------------------------------------------------------- -CREATE TYPE HsOfficeCoopAssetsTransactionType AS ENUM ('ADJUSTMENT', +CREATE TYPE hs_office.HsOfficeCoopAssetsTransactionType AS ENUM ('ADJUSTMENT', 'DEPOSIT', 'DISBURSAL', 'TRANSFER', @@ -13,14 +13,14 @@ CREATE TYPE HsOfficeCoopAssetsTransactionType AS ENUM ('ADJUSTMENT', 'LOSS', 'LIMITATION'); -CREATE CAST (character varying as HsOfficeCoopAssetsTransactionType) WITH INOUT AS IMPLICIT; +CREATE CAST (character varying as hs_office.HsOfficeCoopAssetsTransactionType) WITH INOUT AS IMPLICIT; create table if not exists hs_office.coopassetstransaction ( uuid uuid unique references rbac.object (uuid) initially deferred, version int not null default 0, membershipUuid uuid not null references hs_office.membership(uuid), - transactionType HsOfficeCoopAssetsTransactionType not null, + transactionType hs_office.HsOfficeCoopAssetsTransactionType not null, valueDate date not null, assetValue money not null, reference varchar(48) not null, diff --git a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5128-hs-office-coopassets-test-data.sql b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5128-hs-office-coopassets-test-data.sql index 21a4ef82..da9265d8 100644 --- a/src/main/resources/db/changelog/5-hs-office/512-coopassets/5128-hs-office-coopassets-test-data.sql +++ b/src/main/resources/db/changelog/5-hs-office/512-coopassets/5128-hs-office-coopassets-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single coopAssetsTransaction test record. */ -create or replace procedure createHsOfficeCoopAssetsTransactionTestData( +create or replace procedure hs_office.createHsOfficeCoopAssetsTransactionTestData( givenPartnerNumber numeric, givenMemberNumberSuffix char(2) ) @@ -46,8 +46,8 @@ do language plpgsql $$ call base.defineContext('creating coopAssetsTransaction test-data'); SET CONSTRAINTS ALL DEFERRED; - call createHsOfficeCoopAssetsTransactionTestData(10001, '01'); - call createHsOfficeCoopAssetsTransactionTestData(10002, '02'); - call createHsOfficeCoopAssetsTransactionTestData(10003, '03'); + call hs_office.createHsOfficeCoopAssetsTransactionTestData(10001, '01'); + call hs_office.createHsOfficeCoopAssetsTransactionTestData(10002, '02'); + call hs_office.createHsOfficeCoopAssetsTransactionTestData(10003, '03'); end; $$; diff --git a/src/main/resources/db/changelog/6-hs-booking/630-booking-item/6308-hs-booking-item-test-data.sql b/src/main/resources/db/changelog/6-hs-booking/630-booking-item/6308-hs-booking-item-test-data.sql index 84d53142..03c89b6a 100644 --- a/src/main/resources/db/changelog/6-hs-booking/630-booking-item/6308-hs-booking-item-test-data.sql +++ b/src/main/resources/db/changelog/6-hs-booking/630-booking-item/6308-hs-booking-item-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single hs_booking.item test record. */ -create or replace procedure createHsBookingItemTransactionTestData( +create or replace procedure hs_booking.createHsBookingItemTransactionTestData( givenPartnerNumber numeric, givenDebitorSuffix char(2) ) @@ -49,9 +49,9 @@ do language plpgsql $$ begin call base.defineContext('creating booking-item test-data', null, 'superuser-alex@hostsharing.net', 'rbac.global#global:ADMIN'); - call createHsBookingItemTransactionTestData(10001, '11'); - call createHsBookingItemTransactionTestData(10002, '12'); - call createHsBookingItemTransactionTestData(10003, '13'); + call hs_booking.createHsBookingItemTransactionTestData(10001, '11'); + call hs_booking.createHsBookingItemTransactionTestData(10002, '12'); + call hs_booking.createHsBookingItemTransactionTestData(10003, '13'); end; $$; --// diff --git a/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql b/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql index 72f6527d..e9574b14 100644 --- a/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql +++ b/src/main/resources/db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql @@ -8,7 +8,7 @@ /* Creates a single hs_hosting.asset test record. */ -create or replace procedure createHsHostingAssetTestData(givenProjectCaption varchar) +create or replace procedure hs_office.createHsHostingAssetTestData(givenProjectCaption varchar) language plpgsql as $$ declare relatedProject hs_booking.project; @@ -112,9 +112,9 @@ do language plpgsql $$ begin call base.defineContext('creating hosting-asset test-data', null, 'superuser-alex@hostsharing.net', 'rbac.global#global:ADMIN'); - call createHsHostingAssetTestData('D-1000111 default project'); - call createHsHostingAssetTestData('D-1000212 default project'); - call createHsHostingAssetTestData('D-1000313 default project'); + call hs_office.createHsHostingAssetTestData('D-1000111 default project'); + call hs_office.createHsHostingAssetTestData('D-1000212 default project'); + call hs_office.createHsHostingAssetTestData('D-1000313 default project'); end; $$; --//