diff --git a/src/main/resources/db/changelog/9-hs-global/9100-hs-integration-schema.sql b/src/main/resources/db/changelog/9-hs-global/9100-hs-integration-schema.sql new file mode 100644 index 00000000..1f0a8a44 --- /dev/null +++ b/src/main/resources/db/changelog/9-hs-global/9100-hs-integration-schema.sql @@ -0,0 +1,8 @@ +--liquibase formatted sql + + +-- ============================================================================ +--changeset timotheus.pokorra:hs-integration-SCHEMA endDelimiter:--// +-- ---------------------------------------------------------------------------- +CREATE SCHEMA hs_integration; +--// diff --git a/src/main/resources/db/changelog/9-hs-global/9101-integration-kimai.sql b/src/main/resources/db/changelog/9-hs-global/9101-integration-kimai.sql new file mode 100644 index 00000000..895936c1 --- /dev/null +++ b/src/main/resources/db/changelog/9-hs-global/9101-integration-kimai.sql @@ -0,0 +1,17 @@ +--liquibase formatted sql + +-- ============================================================================ +--changeset timotheus.pokorra:hs-global-integration-kimai endDelimiter:--// +CREATE OR REPLACE VIEW hs_integration.time_customer AS + SELECT p.partnernumber, debitor.defaultprefix + FROM hs_office.partner p + JOIN hs_office.relation AS pRel + ON pRel.type = 'PARTNER' + AND pRel.uuid = p.partnerRelUuid + JOIN hs_office.relation AS dRel + ON dRel.type = 'DEBITOR' + AND dRel.anchorUuid = pRel.holderUuid + JOIN hs_office.debitor AS debitor + ON debitor.debitorreluuid = dRel.uuid + AND debitor.debitornumbersuffix = '00'; +--// \ No newline at end of file diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index 78622a51..20fc9193 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -171,3 +171,7 @@ databaseChangeLog: file: db/changelog/7-hs-hosting/701-hosting-asset/7018-hs-hosting-asset-test-data.sql - include: file: db/changelog/9-hs-global/9000-statistics.sql + - include: + file: db/changelog/9-hs-global/9100-hs-integration-schema.sql + - include: + file: db/changelog/9-hs-global/9101-integration-kimai.sql \ No newline at end of file