Files
lasuite-drive/bin/clear_db_e2e.sql
T
Nathan Vasse c61878253b 🔧(conf) setup handy local e2e env
We want to be able to quickly start a local isolated env for the
e2e testing, we don't want to share to same db with the classic
dev env because the e2e db should be empty before tests execution.
And we don't want to clear our dev db every time. Also provide a new
makefile handy command to launch the e2e env and the tests in one
command, great.
2025-08-27 15:45:15 +02:00

10 lines
269 B
SQL

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