From 47926d0d84eb4bec3024c6471fc94c27ac59296e Mon Sep 17 00:00:00 2001 From: Michael Hoennig Date: Fri, 13 Sep 2024 08:08:19 +0200 Subject: [PATCH] basis.intToVarChar(...) --- .../resources/db/changelog/0-basis/002-int-to-var.sql | 8 ++++---- .../201-test-customer/2018-test-customer-test-data.sql | 2 +- .../2-test/203-test-domain/2038-test-domain-test-data.sql | 2 +- .../501-contact/5018-hs-office-contact-test-data.sql | 2 +- .../502-person/5028-hs-office-person-test-data.sql | 2 +- .../503-relation/5038-hs-office-relation-test-data.sql | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main/resources/db/changelog/0-basis/002-int-to-var.sql b/src/main/resources/db/changelog/0-basis/002-int-to-var.sql index eb3212e3..245f767f 100644 --- a/src/main/resources/db/changelog/0-basis/002-int-to-var.sql +++ b/src/main/resources/db/changelog/0-basis/002-int-to-var.sql @@ -8,10 +8,10 @@ Returns a textual representation of an integer number to be used as generated test data. Examples : - intToVarChar(0, 3) => 'aaa' - intToVarChar(1, 3) => 'aab' + basis.intToVarChar(0, 3) => 'aaa' + basis.intToVarChar(1, 3) => 'aab' */ -create or replace function intToVarChar(i integer, len integer) +create or replace function basis.intToVarChar(i integer, len integer) returns varchar language plpgsql as $$ declare @@ -19,7 +19,7 @@ declare begin select chr(ascii('a') + i % 26) into partial; if len > 1 then - return intToVarChar(i / 26, len - 1) || partial; + return basis.intToVarChar(i / 26, len - 1) || partial; else return partial; end if; diff --git a/src/main/resources/db/changelog/2-test/201-test-customer/2018-test-customer-test-data.sql b/src/main/resources/db/changelog/2-test/201-test-customer/2018-test-customer-test-data.sql index f05cbafb..832e41c2 100644 --- a/src/main/resources/db/changelog/2-test/201-test-customer/2018-test-customer-test-data.sql +++ b/src/main/resources/db/changelog/2-test/201-test-customer/2018-test-customer-test-data.sql @@ -59,7 +59,7 @@ create or replace procedure createTestCustomerTestData( begin for t in startCount..endCount loop - call createTestCustomerTestData(testCustomerReference(t), intToVarChar(t, 3)); + call createTestCustomerTestData(testCustomerReference(t), basis.intToVarChar(t, 3)); commit; end loop; end; $$; diff --git a/src/main/resources/db/changelog/2-test/203-test-domain/2038-test-domain-test-data.sql b/src/main/resources/db/changelog/2-test/203-test-domain/2038-test-domain-test-data.sql index e2aa870f..13d03f14 100644 --- a/src/main/resources/db/changelog/2-test/203-test-domain/2038-test-domain-test-data.sql +++ b/src/main/resources/db/changelog/2-test/203-test-domain/2038-test-domain-test-data.sql @@ -25,7 +25,7 @@ begin insert into test_domain (name, packageUuid) - values (pac.name || '-' || intToVarChar(t, 4), pac.uuid); + values (pac.name || '-' || basis.intToVarChar(t, 4), pac.uuid); end loop; 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 fbee80ad..03bb29ef 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 @@ -44,7 +44,7 @@ create or replace procedure createHsOfficeContactTestData( begin for t in startCount..endCount loop - call createHsOfficeContactTestData(intToVarChar(t, 4) || '#' || t); + call createHsOfficeContactTestData(basis.intToVarChar(t, 4) || '#' || t); commit; end loop; end; $$; 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 8900886c..b2ffde0e 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 @@ -43,7 +43,7 @@ create or replace procedure createTestPersonTestData( begin for t in startCount..endCount loop - call createHsOfficePersonTestData('LP', intToVarChar(t, 4)); + call createHsOfficePersonTestData('LP', basis.intToVarChar(t, 4)); commit; end loop; end; $$; 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 120ffe62..c9975c50 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 @@ -69,8 +69,8 @@ declare begin for t in startCount..endCount loop - select p.* from hs_office_person p where tradeName = intToVarChar(t, 4) into person; - select c.* from hs_office_contact c where c.caption = intToVarChar(t, 4) || '#' || t into contact; + select p.* from hs_office_person p where tradeName = basis.intToVarChar(t, 4) into person; + select c.* from hs_office_contact c where c.caption = basis.intToVarChar(t, 4) || '#' || t into contact; call createHsOfficeRelationTestData(person.uuid, contact.uuid, 'REPRESENTATIVE'); commit;