]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
update mysql updatedb script
authorEric Bollengier <eric@baculasystems.com>
Fri, 30 Sep 2022 06:23:58 +0000 (08:23 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:56:59 +0000 (13:56 +0200)
bacula/updatedb/update_mysql_tables_1025_to_1026.in

index 8d2ba76c320efac8bc465f119776d3bd2ae5a3d8..f9bc73396a9d5115b2f9ae368b7ad41b101ac661 100644 (file)
@@ -1,42 +1,2 @@
-#!/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@}
+Summary: 
 
-mysql $* -D ${db_name} -e "select VersionId from Version\G" >/tmp/$$
-DBVERSION=`sed -n -e 's/^VersionId: \(.*\)$/\1/p' /tmp/$$`
-if [ $DBVERSION != 1024 ] ; 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  <<END-OF-DATA
-USE ${db_name};
-CREATE INDEX meta_emailid on MetaEmail (EmailId);
-INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) VALUES
-  ('DU0001', 'catalog_update', NOW(), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1025');
-
-UPDATE Version SET VersionId=1026;
-END-OF-DATA
-then
-   echo "Update of Bacula MySQL tables 1025 to 1026 succeeded."
-   getVersion
-else
-   echo "Update of Bacula MySQL tables 1025 to 1026 failed."
-   exit 1
-fi
-
-exit 0