611ca74cea
Adds IiosComplianceHold + IiosSourceHandle.redactedAt and a DsrService whose eraseSubject redacts the caller's PII in place (message bodies, identity display, raw payloads, support/inbox/transcript text) while preserving externalId (source preservation), structure, and the audit trail. An active compliance hold blocks erasure until released; every op is audited and tenant-fenced. Erasure is idempotent (KG-03). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
22 lines
711 B
SQL
22 lines
711 B
SQL
-- AlterTable
|
|
ALTER TABLE "IiosSourceHandle" ADD COLUMN "redactedAt" TIMESTAMP(3);
|
|
|
|
-- CreateTable
|
|
CREATE TABLE "IiosComplianceHold" (
|
|
"id" TEXT NOT NULL,
|
|
"scopeId" TEXT NOT NULL,
|
|
"targetType" TEXT NOT NULL,
|
|
"targetId" TEXT NOT NULL,
|
|
"holdReason" TEXT NOT NULL,
|
|
"appliedByActorId" TEXT,
|
|
"status" TEXT NOT NULL DEFAULT 'ACTIVE',
|
|
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
"expiresAt" TIMESTAMP(3),
|
|
"releasedAt" TIMESTAMP(3),
|
|
|
|
CONSTRAINT "IiosComplianceHold_pkey" PRIMARY KEY ("id")
|
|
);
|
|
|
|
-- CreateIndex
|
|
CREATE INDEX "IiosComplianceHold_scopeId_targetType_targetId_status_idx" ON "IiosComplianceHold"("scopeId", "targetType", "targetId", "status");
|