Fix: Cleanup-Seed löscht Initiatives vor pytest-Actors (FK RESTRICT).
All checks were successful
Deploy Development / deploy (push) Successful in 32s
Test Suite / pytest-backend (push) Successful in 28s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
All checks were successful
Deploy Development / deploy (push) Successful in 32s
Test Suite / pytest-backend (push) Successful in 28s
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Test Suite / k6 /api/health Baseline (push) Successful in 18s
Test Suite / playwright-smoke (push) Successful in 12s
This commit is contained in:
parent
afa68150c0
commit
a34a61458e
|
|
@ -4,6 +4,21 @@
|
|||
-- Reparatur: ungültige Human-Actors (user_id NULL verletzt CHECK constraint)
|
||||
DELETE FROM actors WHERE actor_type = 'human' AND user_id IS NULL;
|
||||
|
||||
-- AP0.5: Vorhaben/Maßnahmen pytest-Artefakte vor Actor-Löschung entfernen
|
||||
-- (initiatives.owner_actor_id → actors ON DELETE RESTRICT)
|
||||
DELETE FROM initiatives
|
||||
WHERE owner_actor_id IN (
|
||||
SELECT id FROM actors WHERE user_id IN (SELECT id FROM users WHERE email ~* '@example\.com$')
|
||||
);
|
||||
|
||||
DELETE FROM initiatives i
|
||||
USING tenants t
|
||||
WHERE i.tenant_id = t.id
|
||||
AND t.slug ~ '^t-[a-f0-9]{10}$'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM tenant_memberships tm WHERE tm.tenant_id = t.id
|
||||
);
|
||||
|
||||
-- Abhängigkeiten vor User-Löschung (human actors: user_id NOT NULL constraint)
|
||||
DELETE FROM actors
|
||||
WHERE user_id IN (SELECT id FROM users WHERE email ~* '@example\.com$');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user