#!/bin/bash
#
# This routine alters the appropriately configured
#  Bacula tables for PostgreSQL, MySQL, or SQLite.
#

RETVAL=0

. /etc/sysconfig/bacula

case "$BACULA_BACKEND" in
    postgresql)
        echo "Altering PostgreSQL tables"
        /usr/share/bacula/update_postgresql_tables $*
        ;;
    sqlite)
        echo "Altering SQLite tables"
        /usr/share/bacula/update_sqlite_tables $*
        ;;
    sqlite3)
        echo "Altering SQLite3 tables"
        /usr/share/bacula/update_sqlite3_tables $*
        ;;
    mysql)
        echo "Altering MySQL tables"
        /usr/share/bacula/update_mysql_tables $*
        ;;
    *)
        echo "Unknown database type"
        $RETVAL=1
        ;;
esac

exit $RETVAL
