Unveränderter Stand von certvia/dev (a48c5fb) plus Craftvia-Spezifikation und Brandbook unter docs/craftvia/. ISMS-Module werden im Folgecommit entfernt. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
19 lines
844 B
SQL
19 lines
844 B
SQL
-- TISAX M1: Onboarding-Step-Keys umbenannt (scoping→scope, policies→policy).
|
|
-- Bestehende onboarding_progress-Zeilen umschlüsseln, damit der Fortschritt erhalten
|
|
-- bleibt (sonst verwaisen die Alt-Keys und die Schritte starten wieder als „offen").
|
|
-- NOT EXISTS-Guard gegen die @@unique(tenant_id, step_key): existiert der Ziel-Key
|
|
-- bereits, wird nicht umbenannt (die neue Zeile gewinnt).
|
|
UPDATE "onboarding_progress" o SET "step_key" = 'scope'
|
|
WHERE o."step_key" = 'scoping'
|
|
AND NOT EXISTS (
|
|
SELECT 1 FROM "onboarding_progress" i
|
|
WHERE i."tenant_id" = o."tenant_id" AND i."step_key" = 'scope'
|
|
);
|
|
|
|
UPDATE "onboarding_progress" o SET "step_key" = 'policy'
|
|
WHERE o."step_key" = 'policies'
|
|
AND NOT EXISTS (
|
|
SELECT 1 FROM "onboarding_progress" i
|
|
WHERE i."tenant_id" = o."tenant_id" AND i."step_key" = 'policy'
|
|
);
|