add view for list subscriptions

This commit is contained in:
Timotheus Pokorra 2025-01-13 16:26:34 +01:00 committed by Dev und Test fuer hsadminng
parent a7ffee9348
commit 6a673c66d4

View File

@ -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;
--//