]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/drop_postgresql_tables.in
ebl fix segfault with debug mode
[bacula/bacula] / bacula / src / cats / drop_postgresql_tables.in
index 3abd60ef345dceb30064fc7833610433c341a9d3..bcbd1fdd189f9ca14a86d4f1429ab586df861bec 100644 (file)
@@ -3,14 +3,15 @@
 # shell script to delete Bacula tables for PostgreSQL
 
 bindir=@SQL_BINDIR@
+db_name=@db_name@
 
-if $bindir/mysql $* <<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 jobhistory;
 drop table media;
 drop table client;
 drop table pool;
@@ -19,10 +20,21 @@ drop table path;
 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;
 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