-- +goose Up -- Per-tenant activity feed: who changed what. Actor kinds distinguish -- dashboard users (staff), public self-service actions (customer), and -- automatic transitions (system). Kept to booking lifecycle events in v1. CREATE TABLE activity_events ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), tenant_id uuid NOT NULL REFERENCES tenants(id) ON DELETE CASCADE, actor_kind text NOT NULL DEFAULT 'staff', actor_subject text NOT NULL DEFAULT '', actor_name text NOT NULL DEFAULT '', action text NOT NULL, entity_type text NOT NULL DEFAULT 'booking', entity_id uuid, summary text NOT NULL DEFAULT '', created_at timestamptz NOT NULL DEFAULT now() ); CREATE INDEX activity_events_tenant_created_idx ON activity_events (tenant_id, created_at DESC); -- +goose Down DROP TABLE IF EXISTS activity_events;