Files
drive/bin/clear_db_e2e.sql
Nathan Vasse d2ccd79e8c 🔧(e2e) improve e2e test debugging and db cleanup
Preserve django_site table during e2e db clearing to
avoid breaking site configuration. Add video recording
on first retry and screenshot capture on failure for
easier debugging of flaky tests.
2026-02-06 15:58:22 +01:00

10 lines
337 B
SQL

DO $$
DECLARE r RECORD;
BEGIN
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = 'public' AND tablename != 'django_migrations' AND tablename != 'django_site')
LOOP
RAISE NOTICE 'Truncating table %', r.tablename;
EXECUTE 'TRUNCATE TABLE ' || quote_ident(r.tablename) || ' CASCADE';
END LOOP;
END $$;