Files
projectbrain-Public/backend/prisma/migrations/20260902000000_attention_provenance_cleanup/migration.sql
T

20 lines
735 B
SQL

-- Historical fixture and smoke records are useful evidence, but were never
-- real owner decisions. Close only those narrowly identified pending items.
UPDATE "ReviewQueueItem"
SET
"status" = 'rejected',
"approvalState" = 'rejected',
"notes" = CASE
WHEN "notes" IS NULL OR "notes" = '' THEN 'Automatically closed: synthetic seed or smoke evidence is not a human attention item.'
ELSE "notes" || E'\nAutomatically closed: synthetic seed or smoke evidence is not a human attention item.'
END,
"updatedBy" = 'attention_policy_migration',
"updatedAt" = CURRENT_TIMESTAMP
WHERE
"status" = 'pending'
AND (
"createdBy" = 'seed'
OR LOWER("source") LIKE '%smoke%'
OR LOWER("sourceType") LIKE '%smoke%'
);