-- AlterEnum ALTER TYPE "AdminAuditAction" ADD VALUE 'ai_settings_changed'; -- CreateTable CREATE TABLE "AiCall" ( "id" TEXT NOT NULL, "userId" TEXT, "helper" TEXT NOT NULL, "outcome" TEXT NOT NULL, "chargedCents" DOUBLE PRECISION NOT NULL DEFAULT 0, "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, CONSTRAINT "AiCall_pkey" PRIMARY KEY ("id") ); -- CreateIndex CREATE INDEX "AiCall_createdAt_idx" ON "AiCall"("createdAt"); -- CreateIndex CREATE INDEX "AiCall_userId_createdAt_idx" ON "AiCall"("userId", "createdAt"); -- AddForeignKey ALTER TABLE "AiCall" ADD CONSTRAINT "AiCall_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE; -- 2.0 AI helpers: Anthropic in the operator register, off until the site uses AI. INSERT INTO "Operator" ("id", "name", "purpose", "dataShared", "location", "website", "active", "order", "updatedAt") VALUES (gen_random_uuid()::text, 'Anthropic (Claude), through the software provider''s Hub', 'AI helpers for staff: drafting events and messages, improving text, summarising reports and feedback', 'The text a staff member asks to draft or improve, report figures, and feedback comments with names and contact details removed. Not kept by the software provider; Anthropic''s commercial terms apply', 'United States', 'https://www.anthropic.com/legal/privacy', false, 9, CURRENT_TIMESTAMP);