Files
oc-sentinel/infra/postgres/002_organization_report_recipients.sql
OfficeCom Codex dfdae7a532
Some checks failed
OfficeCom Sentinel Client / validate-client (push) Successful in 23s
OfficeCom Sentinel Client / build-client-windows (push) Failing after 19s
Manage weekly report recipients centrally
2026-07-26 11:09:26 +02:00

26 lines
906 B
PL/PgSQL

-- Central recipient rules for OCSentinel weekly organization reports.
-- The '*' organization ID applies to every organization.
BEGIN;
CREATE TABLE IF NOT EXISTS ocsentinel.organization_report_recipient (
id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
organization_id TEXT NOT NULL,
organization_name TEXT NOT NULL,
recipient_email TEXT NOT NULL,
enabled BOOLEAN NOT NULL DEFAULT TRUE,
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
UNIQUE (organization_id, recipient_email)
);
INSERT INTO ocsentinel.organization_report_recipient
(organization_id, organization_name, recipient_email)
VALUES
('*', 'Alle Organisationen', 'lg@officecom.it'),
('*', 'Alle Organisationen', 'rk@officecom.biz'),
('9', 'Mildenberger Verlag', 'dd@officecom.it'),
('16', 'Kirsch GmbH', 'dd@officecom.it')
ON CONFLICT (organization_id, recipient_email) DO NOTHING;
COMMIT;