mirror of
https://github.com/suitenumerique/drive.git
synced 2026-09-22 09:35:12 +02:00
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.
10 lines
269 B
SQL
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 $$;
|