]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Update update_mysql_tables.in for MySQL cluster support
authorEric Bollengier <eric@baculasystems.com>
Wed, 14 Oct 2020 13:10:49 +0000 (15:10 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:57 +0000 (09:02 +0100)
bacula/src/cats/update_mysql_tables.in

index c920c8fdd184b512330e7f03b942902c2bc7fd7f..3178ac588dabb71a4776b2e3c6e2bd90a246c068 100644 (file)
@@ -493,5 +493,21 @@ END-OF-DATA
     fi
 fi
 
+if [ "$DBVERSION" -eq 1022 ] ; then
+    if mysql $* -f  <<END-OF-DATA
+USE ${db_name};
+ALTER TABLE FileMedia ADD FileMediaId integer auto_increment primary key;
+ALTER TABLE JobHisto MODIFY COLUMN JobId int PRIMARY KEY AUTO_INCREMENT;
+ALTER TABLE Version MODIFY COLUMN VersionId int PRIMARY KEY;
+UPDATE Version SET VersionId=1023;
+END-OF-DATA
+    then
+        echo "Update of Bacula MySQL tables 1022 to 1023 succeeded."
+        getVersion
+    else
+        echo "Update of Bacula MySQL tables 1022 to 1023 failed."
+        exit 1
+    fi
+fi
 
 exit 0