Files
coding-starter/migrations/ch/2026-04-17_email_events.sql

12 lines
352 B
SQL

CREATE TABLE IF NOT EXISTS newsletter.email_events (
event_type LowCardinality(String),
tenant_id String,
campaign_id UUID,
recipient_hash String,
timestamp DateTime64(3, 'UTC'),
metadata Map(String, String)
)
ENGINE = MergeTree()
PARTITION BY toYYYYMM(timestamp)
ORDER BY (tenant_id, campaign_id, event_type, timestamp);