CREATE TABLE IF NOT EXISTS mail_folder_state_events (
    id           BIGSERIAL PRIMARY KEY,
    tenant_slug  TEXT NOT NULL,
    mailbox_name TEXT NOT NULL,
    event_type   TEXT NOT NULL CHECK (event_type IN ('uid_assigned', 'deleted', 'rebuilt')),
    uid          BIGINT,
    created_at   TIMESTAMPTZ NOT NULL DEFAULT now()
)
