Idempotentes Data-Seed-System neben Schema-Migrationen einfuehren.
Deploy Development / deploy (push) Failing after 36s
Test Suite / pytest-backend (push) Failing after 0s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Deploy Development / deploy (push) Failing after 36s
Test Suite / pytest-backend (push) Failing after 0s
Test Suite / k6 /api/health Baseline (push) Has been skipped
Test Suite / playwright-smoke (push) Has been skipped
Test Suite / lint-backend (push) Successful in 2s
Test Suite / compose-smoke (push) Has been skipped
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
2f631f419a
commit
7a6eb3abe8
12 files changed
+440
-5
No files matched your search
@@ -0,0 +1,32 @@
|
||||
-- Dev/CI: pytest-Artefakte entfernen (idempotent, sicher mehrfach ausführbar).
|
||||
-- Nur in Nicht-Prod-Umgebungen (Dateiname *.dev.sql).
|
||||
|
||||
-- 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$');
|
||||
|
||||
DELETE FROM tenant_memberships
|
||||
WHERE user_id IN (SELECT id FROM users WHERE email ~* '@example\.com$');
|
||||
|
||||
DELETE FROM sessions
|
||||
WHERE user_id IN (SELECT id FROM users WHERE email ~* '@example\.com$');
|
||||
|
||||
DELETE FROM audit_log
|
||||
WHERE user_id IN (SELECT id FROM users WHERE email ~* '@example\.com$');
|
||||
|
||||
DELETE FROM users WHERE email ~* '@example\.com$';
|
||||
|
||||
-- Verwaiste pytest-Tenants (Factory-Slug t-{10 hex}), ohne Memberships
|
||||
DELETE FROM actors a
|
||||
USING tenants t
|
||||
WHERE a.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
|
||||
);
|
||||
|
||||
DELETE FROM tenants t
|
||||
WHERE t.slug ~ '^t-[a-f0-9]{10}$'
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM tenant_memberships tm WHERE tm.tenant_id = t.id
|
||||
);
|
||||
@@ -0,0 +1,9 @@
|
||||
"""Bootstrap portal admin from KAIRO_BOOTSTRAP_* when no users exist."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def run() -> None:
|
||||
from bootstrap import bootstrap_admin_if_needed
|
||||
|
||||
bootstrap_admin_if_needed()
|
||||
Reference in new issue
Block a user