#
# shell script to delete Bacula tables for PostgreSQL
-bindir=@SQL_BINDIR@
+bindir=@POSTGRESQL_BINDIR@
+db_name=@db_name@
-if $bindir/psql -f - -d bacula $* <<END-OF-DATA
+$bindir/psql -f - -d ${db_name} $* <<END-OF-DATA
drop table unsavedfiles;
drop table basefiles;
drop table jobmedia;
drop table file;
drop table job;
+drop table jobhisto;
drop table media;
drop table client;
drop table pool;
drop table Storage;
drop table MediaType;
drop table Status;
+drop table MAC;
+drop table log;
+drop table Location;
+drop table locationlog;
+drop table PathVisibility;
+drop table PathHierarchy;
+drop table RestoreObject;
END-OF-DATA
+pstat=$?
+if test $pstat = 0;
then
echo "Deletion of Bacula PostgreSQL tables succeeded."
else
echo "Deletion of Bacula PostgreSQL tables failed."
fi
-exit 0
+exit $pstat