X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=bacula%2Fsrc%2Fcats%2Fupdate_mysql_tables.in;h=f1b5e16463cfc413b7c00035c0e7924b2a9de0e0;hb=cd7acc68ac7b79a612e3c3ce64fa191e303e2c72;hp=64797d65f2a439ded9f740d95c50a0e02fce220e;hpb=e49eeb329063a864ea561cd3728ffd2251cf42a5;p=bacula%2Fbacula diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in old mode 100755 new mode 100644 index 64797d65f2..f1b5e16463 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -1,32 +1,51 @@ #!/bin/sh # -# Shell script to update MySQL tables from version 1.34 to 1.35.5 +# Shell script to update MySQL Enterprise version 2.6.x to 4.0.x +# or Bacula Community version 5.0.x to 5.2.x # echo " " -echo "This script will update a Bacula MySQL database from version 7 to 8" -echo "Depending on the size of your database," -echo "this script may take several minutes to run." +echo "This script will update a Bacula MySQL database from version 12 to 13" +echo " which is needed to convert from Bacula Enterprise version 2.6.x to 6.0.x" +echo " or Bacula Community version 5.0.x to 5.2.x" echo " " bindir=@SQL_BINDIR@ +PATH="$bindir:$PATH" +db_name=@db_name@ -if $bindir/mysql $* -f </tmp/$$ +DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` +if [ $DBVERSION != 12 ] ; then + echo " " + echo "The existing database is version $DBVERSION !!" + echo "This script can only update an existing version 12 database to version 13." + echo "Error. Cannot upgrade this database." + echo " " + exit 1 +fi -ALTER TABLE File ADD INDEX (JobId, PathId, FilenameId); +if mysql $* -f <