[fix] ajout /scripts necessaire au Makefile

pull/30/head
Vincent Adolphe 2017-11-30 17:00:36 +01:00
Parent e1e68ee5f0
révision e35fddc287
1 fichiers modifiés avec 10 ajouts et 0 suppressions

10
scripts/psql_reset.sql Normal file
Voir le fichier

@ -0,0 +1,10 @@
DO $$ DECLARE
r RECORD;
BEGIN
-- if the schema you operate on is not "current", you will want to
-- replace current_schema() in query with 'schematodeletetablesfrom'
-- *and* update the generate 'DROP...' accordingly.
FOR r IN (SELECT tablename FROM pg_tables WHERE schemaname = current_schema()) LOOP
EXECUTE 'DROP TABLE IF EXISTS ' || quote_ident(r.tablename) || ' CASCADE';
END LOOP;
END $$;