Files
lasuite-drive/bin/clear_db_e2e.sql
T
Nathan Vasse a7b040b927 ♻️(utils) Stop truncating e2e migrations tables
This was causing major issues when emptying the e2e db
between tests, it's quite obvious to understand why.
2025-09-15 17:00:34 +02:00

10 lines
306 B
SQL

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