]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/drop_postgresql_tables.in
Fix bug #1891
[bacula/bacula] / bacula / src / cats / drop_postgresql_tables.in
index 35ec37784599c5125bdbfe52766f7ce4e8bc2b74..42db832e4490c87b8b96a4f9b37501adaa184c64 100644 (file)
@@ -2,15 +2,16 @@
 #
 # shell script to delete Bacula tables for PostgreSQL
 
-bindir=@SQL_BINDIR@
+bindir=@POSTGRESQL_BINDIR@
+db_name=@db_name@
 
-if $bindir/psql $* -f - <<END-OF-DATA
-\c bacula
+$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;
@@ -20,10 +21,23 @@ drop table filename;
 drop table counters;
 drop table version;
 drop table CDImages;
+drop table Device;
+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