From 6a673c66d480a4c9eadb10c3f0e312da9b466760 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Mon, 13 Jan 2025 16:26:34 +0100 Subject: [PATCH 1/2] add view for list subscriptions --- .../9-hs-global/9130-integration-mlmmj.sql | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/main/resources/db/changelog/9-hs-global/9130-integration-mlmmj.sql diff --git a/src/main/resources/db/changelog/9-hs-global/9130-integration-mlmmj.sql b/src/main/resources/db/changelog/9-hs-global/9130-integration-mlmmj.sql new file mode 100644 index 00000000..a7ab0d9e --- /dev/null +++ b/src/main/resources/db/changelog/9-hs-global/9130-integration-mlmmj.sql @@ -0,0 +1,14 @@ + +--liquibase formatted sql + +-- ============================================================================ +--changeset timotheus.pokorra:hs-global-integration-znuny endDelimiter:--// +CREATE OR REPLACE VIEW hs_integration.subscription AS + SELECT DISTINCT + relation.mark as subscription, + contact.emailaddresses->>'main' as email + FROM hs_office.contact AS contact + JOIN hs_office.relation AS relation ON relation.contactuuid = contact.uuid AND relation.type = 'SUBSCRIBER' + ORDER BY subscription, email; + +--// -- 2.39.5 From d6edfa4dc7e5b0fa18bb8e16d031bf4e161c9e01 Mon Sep 17 00:00:00 2001 From: Timotheus Pokorra Date: Thu, 16 Jan 2025 08:36:30 +0100 Subject: [PATCH 2/2] add sql file for mlmmj integration view to db changelog --- src/main/resources/db/changelog/db.changelog-master.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/resources/db/changelog/db.changelog-master.yaml b/src/main/resources/db/changelog/db.changelog-master.yaml index b97e3f2d..1f4e8ea0 100644 --- a/src/main/resources/db/changelog/db.changelog-master.yaml +++ b/src/main/resources/db/changelog/db.changelog-master.yaml @@ -176,4 +176,6 @@ databaseChangeLog: - include: file: db/changelog/9-hs-global/9110-integration-kimai.sql - include: - file: db/changelog/9-hs-global/9120-integration-znuny.sql \ No newline at end of file + file: db/changelog/9-hs-global/9120-integration-znuny.sql + - include: + file: db/changelog/9-hs-global/9130-integration-mlmmj.sql -- 2.39.5