mirror of
https://github.com/suitenumerique/drive.git
synced 2026-09-22 09:35:12 +02:00
Make psql script more versatile and avoid unnecessary environment variables parsing.
10 lines
337 B
SQL
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 $$;
|