From: Eric Bollengier Date: Tue, 29 Mar 2022 06:55:16 +0000 (+0200) Subject: Fix SQLite update script and add upgrade event X-Git-Tag: Release-13.0.0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59d497e73f35d265d964c5828d12777290e7561b;p=thirdparty%2Fbacula.git Fix SQLite update script and add upgrade event --- diff --git a/bacula/src/cats/update_mysql_tables.in b/bacula/src/cats/update_mysql_tables.in index 47721a231..dcbe04f25 100644 --- a/bacula/src/cats/update_mysql_tables.in +++ b/bacula/src/cats/update_mysql_tables.in @@ -540,6 +540,8 @@ USE ${db_name}; ALTER TABLE Object ADD ObjectStatus BINARY(1) DEFAULT 'U'; ALTER TABLE Object ADD ObjectCount INTEGER UNSIGNED DEFAULT 1; create index object_status_idx on Object (ObjectStatus); +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 1024'); UPDATE Version SET VersionId=1024; END-OF-DATA then diff --git a/bacula/src/cats/update_postgresql_tables.in b/bacula/src/cats/update_postgresql_tables.in index 691ac79e6..d0b64bf97 100644 --- a/bacula/src/cats/update_postgresql_tables.in +++ b/bacula/src/cats/update_postgresql_tables.in @@ -591,6 +591,8 @@ begin; ALTER TABLE Object ADD COLUMN ObjectStatus char(1) default 'U'; ALTER TABLE Object ADD COLUMN ObjectCount integer default 1; create index object_status_idx on Object (ObjectStatus); +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 1024'); UPDATE Version SET VersionId=1024; commit; END-OF-DATA diff --git a/bacula/src/cats/update_sqlite3_tables.in b/bacula/src/cats/update_sqlite3_tables.in index 5d86961c7..10847260f 100644 --- a/bacula/src/cats/update_sqlite3_tables.in +++ b/bacula/src/cats/update_sqlite3_tables.in @@ -477,7 +477,7 @@ begin; ALTER TABLE Object ADD COLUMN ObjectCategory text not null; create index object_category_idx on Object (ObjectCategory); 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 1023'); + VALUES ('DU0001', 'catalog_update', strftime('%Y-%m-%d %H-%M-%S','now'), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1023'); UPDATE Version SET VersionId=1023; commit; END-OF-DATA @@ -496,6 +496,8 @@ begin; ALTER TABLE Object ADD COLUMN ObjectStatus char(1) default 'U'; ALTER TABLE Object ADD COLUMN ObjectCount integer default 1; create index object_status_idx on Object (ObjectStatus); +INSERT INTO Events (EventsCode, EventsType, EventsTime, EventsDaemon, EventsSource, EventsRef, EventsText) + VALUES ('DU0001', 'catalog_update', strftime('%Y-%m-%d %H-%M-%S','now'), '*SHELL*', 'update_bacula_tables', 'pid$$', 'Catalog schema was updated to 1024'); UPDATE Version SET VersionId=1024; commit; END-OF-DATA