CREATE OR REPLACE FUNCTION food600.drop_views(
	)
    RETURNS integer
    LANGUAGE 'plpgsql'
    COST 100
    VOLATILE
AS $BODY$
DECLARE
  db RECORD;
  deleted INTEGER := 0;
BEGIN
  FOR db IN
    SELECT table_name FROM information_schema.views where table_schema = 'food600'
  LOOP
    deleted := deleted + 1;
    RAISE NOTICE '% Drop view %', deleted, db.table_name ;
    EXECUTE 'drop view if exists food600."' || db.table_name || '" cascade';
  END LOOP;
  RETURN deleted;
END;
$BODY$;
