#!/bin/sh
#
# Drop Bacula tables -- works for whatever is configured,
-# MySQL or SQLite
-#
-if test xsqlite = x@DB_NAME@ ; then
- source ./drop_sqlite_tables
- echo "Dropped SQLite tables"
-else
- source ./drop_mysql_tables
- echo "Dropped MySQL tables"
+# MySQL, SQLite, Ingres, or PostgreSQL
+#
+
+default_db_type=@DEFAULT_DB_TYPE@
+
+#
+# See if the first argument is a valid backend name.
+# If so the user overrides the default database backend.
+#
+if [ $# -gt 0 ]; then
+ case $1 in
+ sqlite3)
+ db_type=$1
+ shift
+ ;;
+ mysql)
+ db_type=$1
+ shift
+ ;;
+ postgresql)
+ db_type=$1
+ shift
+ ;;
+ ingres)
+ db_type=$1
+ shift
+ ;;
+ *)
+ ;;
+ esac
+fi
+
+#
+# If no new db_type is gives use the default db_type.
+#
+if [ -z "${db_type}" ]; then
+ db_type="${default_db_type}"
fi
+
+@scriptdir@/drop_${db_type}_tables $*
+echo "Dropped ${db_type} tables"