]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/cats/update_bacula_tables.in
Tweak version date
[bacula/bacula] / bacula / src / cats / update_bacula_tables.in
index 40b9a89a2e85350aa883fab85a474108971a3f55..943c3109df2fdb7710577c29513185ed9a7491cb 100755 (executable)
@@ -1,18 +1,44 @@
 #!/bin/sh
 #
 # This routine alters the appropriately configured
-#  Bacula tables for PostgreSQL, MySQL, or SQLite.
+# Bacula tables for PostgreSQL, Ingres, MySQL, or SQLite.
 #
-if test xsqlite = x@DB_NAME@ ; then
-  echo "Altering SQLite tables"
-  @scriptdir@/update_sqlite_tables
-fi
-if test xmysql = x@DB_NAME@ ; then
-  echo "Altering MySQL tables"
-  @scriptdir@/update_mysql_tables $*
+
+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 test xpostgresql = x@DB_NAME@ ; then
-  echo "Altering PostgreSQL tables"
-  # we need the bacula datbase name in here... Should not be hardcoded
-  @scriptdir@/update_postgresql_tables bacula
+
+#
+# If no new db_type is gives use the default db_type.
+#
+if [ -z "${db_type}" ]; then
+   db_type="${default_db_type}"
 fi
+
+echo "Altering ${db_type} tables"
+@scriptdir@/update_${db_type}_tables $*