-- +goose Up -- Persistent read state for the notification feed: one cursor per -- dashboard user per tenant. Events with created_at <= read_at count as -- read; everything newer is unread. Per-event flags were rejected — the -- feed is an audit list, not a per-item inbox. CREATE TABLE notification_cursors ( tenant_id uuid NOT NULL REFERENCES tenants(id) ON DELETE CASCADE, user_subject text NOT NULL, read_at timestamptz NOT NULL, updated_at timestamptz NOT NULL DEFAULT now(), PRIMARY KEY (tenant_id, user_subject) ); -- +goose Down DROP TABLE IF EXISTS notification_cursors;