From: Alain Spineux Date: Fri, 18 Nov 2022 15:26:57 +0000 (+0100) Subject: sqlite3: use AUTOINCREMENT for JobId to avoid reuse of old jobid when purging X-Git-Tag: Beta-15.0.0~356 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b0846a6481a682ce43c9b3e6c8e20e0ee060c821;p=thirdparty%2Fbacula.git sqlite3: use AUTOINCREMENT for JobId to avoid reuse of old jobid when purging --- diff --git a/bacula/src/cats/make_sqlite3_tables.in b/bacula/src/cats/make_sqlite3_tables.in index 5987d18d4..da019118f 100644 --- a/bacula/src/cats/make_sqlite3_tables.in +++ b/bacula/src/cats/make_sqlite3_tables.in @@ -221,7 +221,7 @@ CREATE INDEX restore_jobid_idx ON RestoreObject (JobId); CREATE TABLE Job ( - JobId INTEGER, + JobId INTEGER PRIMARY KEY AUTOINCREMENT, Job VARCHAR(128) NOT NULL, Name VARCHAR(128) NOT NULL, Type CHAR(1) NOT NULL, @@ -259,8 +259,7 @@ CREATE TABLE Job ( WriteStorageId integer default 0, -- Id of the Storage used to Write WriteDevice text default '', -- Name of the Write Device StatusInfo text default '', -- Info to determine the error status - Encrypted int default 0, -- 0 no, 1 fd side, 2 sd side, 3 both - PRIMARY KEY(JobId) + Encrypted int default 0 -- 0 no, 1 fd side, 2 sd side, 3 both ); CREATE INDEX inx6 ON Job (Name);