fix(migration): control_suppressions ohne FK auf canonical_controls
prod-canonical_controls (aus dem DB-Swap) hat weder PK noch Unique auf id → FK InvalidForeignKey. control_uuid bleibt UUID (logische Referenz), wie die bereits FK-lose atom_classification auf prod. [migration-approved] Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
-- (actor + reason + created_at beantworten "warum nicht geprüft?"). PER-TENANT.
|
||||
-- Composite PK (tenant_id, control_uuid) = genau eine aktuelle Zeile je
|
||||
-- Mandant+Control; Re-Suppress reaktiviert. Additiv, idempotent. [migration-approved]
|
||||
-- HINWEIS: KEINE FK auf canonical_controls(id) — die prod-DB (aus dem DB-Swap)
|
||||
-- hat dort weder PK noch Unique auf id (atom_classification ist dort ebenfalls
|
||||
-- FK-los). control_uuid referenziert Controls daher nur logisch.
|
||||
|
||||
SET search_path TO compliance, public;
|
||||
|
||||
@@ -16,8 +19,7 @@ BEGIN
|
||||
|
||||
CREATE TABLE IF NOT EXISTS control_suppressions (
|
||||
tenant_id UUID NOT NULL,
|
||||
control_uuid UUID NOT NULL
|
||||
REFERENCES canonical_controls(id) ON DELETE CASCADE,
|
||||
control_uuid UUID NOT NULL,
|
||||
reason TEXT,
|
||||
actor VARCHAR(120),
|
||||
active BOOLEAN NOT NULL DEFAULT TRUE,
|
||||
|
||||
Reference in New Issue
Block a user