From: Eric Bollengier Date: Wed, 2 Jun 2021 08:05:04 +0000 (+0200) Subject: Update MySQL update procedure for 5.6 X-Git-Tag: Release-11.0.5~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=03792ea80f748cdf6d7a3cc449d8c477847c5920;p=thirdparty%2Fbacula.git Update MySQL update procedure for 5.6 --- diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index 0d8094f29..0d63f4460 100644 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -171,10 +171,14 @@ ALTER TABLE RestoreObject ALTER TABLE BaseFiles MODIFY FileIndex INTEGER UNSIGNED DEFAULT 0; -DROP INDEX IF EXISTS JobId on File; -DROP INDEX IF EXISTS JobId_2 on File; +-- If you re-execute the procedure, you can comment out +-- these two lines +DROP INDEX JobId on File; +DROP INDEX JobId_2 on File; -CREATE TABLE IF NOT EXISTS file_temp ( +DROP TABLE IF EXISTS file_temp; + +CREATE TABLE file_temp ( FileId BIGINT UNSIGNED NOT NULL, FileIndex INTEGER DEFAULT 0, JobId INTEGER UNSIGNED NOT NULL, @@ -186,8 +190,6 @@ CREATE TABLE IF NOT EXISTS file_temp ( MD5 TINYBLOB ); -TRUNCATE TABLE file_temp; - INSERT INTO file_temp (FileId, FileIndex, JobId, PathId, Filename, DeltaSeq, MarkId, LStat, Md5) SELECT FileId, FileIndex, JobId, PathId, Filename.Name, DeltaSeq, @@ -497,7 +499,7 @@ CREATE TABLE Events EventsCode TINYBLOB NOT NULL, EventsType TINYBLOB NOT NULL, EventsTime DATETIME, - EventsInsertTime DATETIME DEFAULT NOW(), + EventsInsertTime DATETIME, EventsDaemon TINYBLOB NOT NULL, EventsSource TINYBLOB NOT NULL, EventsRef TINYBLOB NOT NULL,