-- V16: Index for faster email dispatch queries on notification_preferences
-- Used by NotificationDispatchService to find users with EMAIL channel enabled per tenant

CREATE INDEX IF NOT EXISTS idx_notification_preferences_email_enabled
    ON notification_preferences(tenant_id, channel, enabled)
    WHERE channel = 'EMAIL' AND enabled = true;
