#!/bin/sh
#
-# shell script to delete Bacula tables
+# shell script to delete Bacula tables for MySQL
bindir=@SQL_BINDIR@
+db_name=@db_name@
-if $bindir/mysql <<END-OF-DATA
-USE bacula;
+if $bindir/mysql $* <<END-OF-DATA
+USE ${db_name};
DROP TABLE IF EXISTS Filename;
DROP TABLE IF EXISTS Path;
DROP TABLE IF EXISTS LongName;
+DROP TABLE IF EXISTS Device;
+DROP TABLE IF EXISTS Storage;
+DROP TABLE IF EXISTS MediaType;
DROP TABLE IF EXISTS File;
DROP TABLE IF EXISTS Client;
DROP TABLE IF EXISTS Job;
DROP TABLE IF EXISTS MultiVolume;
DROP TABLE IF EXISTS FileSave;
DROP TABLE IF EXISTS FileSet;
+DROP TABLE IF EXISTS Version;
+DROP TABLE IF EXISTS Counters;
+DROP TABLE IF EXISTS BaseFiles;
+DROP TABLE IF EXISTS UnsavedFiles;
+DROP TABLE IF EXISTS CDImages;
+DROP TABLE IF EXISTS Status;
+DROP TABLE IF EXISTS MAC;
+DROP TABLE IF EXISTS Log;
+DROP TABLE IF EXISTS Location;
+DROP TABLE IF EXISTS LocationLog;
END-OF-DATA
then
- echo "Deletion of Bacula tables succeeded."
+ echo "Deletion of ${db_name} MySQL tables succeeded."
else
- echo "Deletion of Bacula tables failed."
+ echo "Deletion of ${db_name} MySQL tables failed."
fi
exit 0