]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
sqlite3: use AUTOINCREMENT for JobId to avoid reuse of old jobid when purging
authorAlain Spineux <alain@baculasystems.com>
Fri, 18 Nov 2022 15:26:57 +0000 (16:26 +0100)
committerEric Bollengier <eric@baculasystems.com>
Thu, 14 Sep 2023 11:57:00 +0000 (13:57 +0200)
bacula/src/cats/make_sqlite3_tables.in

index 5987d18d49ff8e5e525e643aaba698270412e49d..da019118f0b76fb4951133de6e6dc29412e149af 100644 (file)
@@ -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);