From: Eric Bollengier Date: Mon, 3 Oct 2022 08:14:00 +0000 (+0200) Subject: create update_mysql_tables for 1026 X-Git-Tag: Beta-15.0.0~433 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd1760e5ce7beaf4521cb77f37c550113661241e;p=thirdparty%2Fbacula.git create update_mysql_tables for 1026 --- diff --git a/bacula/updatedb/update_mysql_tables_1025_to_1026.in b/bacula/updatedb/update_mysql_tables_1025_to_1026.in index f9bc73396..f57efe61a 100644 --- a/bacula/updatedb/update_mysql_tables_1025_to_1026.in +++ b/bacula/updatedb/update_mysql_tables_1025_to_1026.in @@ -1,2 +1,116 @@ -Summary: +#!/bin/sh +# +# Copyright (C) 2000-2022 Kern Sibbald +# License: BSD 2-Clause; see file LICENSE-FOSS +# +# Shell script to update MySQL +# +echo " " +echo "This script will update a Bacula MySQL database from version 1025 to 1026" +echo " " +bindir=@MYSQL_BINDIR@ +PATH="$bindir:$PATH" +db_name=${db_name:-@db_name@} +mysql $* -D ${db_name} -e "select VersionId from Version\G" >/tmp/$$ +DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$` +if [ $DBVERSION != 1025 ] ; then + echo " " + echo "The existing database is version $DBVERSION !!" + echo "This script can only update an existing version 1025 database to version 1026." + echo "Error. Cannot upgrade this database." + echo " " + exit 1 +fi + +if mysql $* -f <