Reorganize repo structure and standards references

This commit is contained in:
david committed 2026-06-29 05:03:42 +02:00
1 parent 3cb93a81be
commit be2054274d
5885 files changed
+2588 -195

No files matched your search

@@ -0,0 +1,24 @@
-- Compliance-Audit-Export (Phase 10 Task #67).
--
-- Extends AuditEvent with SOC2/HIPAA/GDPR compliance fields and a tamper-evident
-- hash chain (previousHash, eventHash). Backfills existing rows with safe
-- defaults; outcome defaults to "success" and dataSensitivity to "internal" so
-- the integrity-verifier treats pre-migration history as unchained (eventHash
-- NULL means "not part of chain yet").
ALTER TABLE "AuditEvent"
ADD COLUMN "actorEmail" TEXT,
ADD COLUMN "actorIp" TEXT,
ADD COLUMN "actorUserAgent" TEXT,
ADD COLUMN "sourceModule" TEXT,
ADD COLUMN "outcome" TEXT NOT NULL DEFAULT 'success',
ADD COLUMN "dataSensitivity" TEXT NOT NULL DEFAULT 'internal',
ADD COLUMN "regulatoryScope" TEXT[] NOT NULL DEFAULT ARRAY[]::TEXT[],
ADD COLUMN "previousHash" TEXT,
ADD COLUMN "eventHash" TEXT;
CREATE INDEX "audit_event_tenant_action_created_at_idx"
ON "AuditEvent" ("tenantId", "action", "createdAt");
CREATE INDEX "audit_event_tenant_outcome_created_at_idx"
ON "AuditEvent" ("tenantId", "outcome", "createdAt");