From: Eric Bollengier Date: Sun, 15 Jun 2008 14:49:03 +0000 (+0000) Subject: ebl Update SQLite for Long term statistics X-Git-Tag: Release-3.0.0~1301 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7a016f8ec562dcbc210c1d2da5f75ac8b8f4d602;p=bacula%2Fbacula ebl Update SQLite for Long term statistics git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@7148 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/cats/make_sqlite3_tables.in b/bacula/src/cats/make_sqlite3_tables.in index aea3628f6e..e4f42569bf 100644 --- a/bacula/src/cats/make_sqlite3_tables.in +++ b/bacula/src/cats/make_sqlite3_tables.in @@ -76,7 +76,33 @@ CREATE TABLE Job ( CREATE INDEX inx6 ON Job (Name); -- Create a table like Job for long term statistics -CREATE TABLE JobStat (LIKE Job); +CREATE TABLE JobStat ( + JobId INTEGER, + Job VARCHAR(128) NOT NULL, + Name VARCHAR(128) NOT NULL, + Type CHAR NOT NULL, + Level CHAR NOT NULL, + ClientId INTEGER REFERENCES Client DEFAULT 0, + JobStatus CHAR NOT NULL, + SchedTime DATETIME NOT NULL, + StartTime DATETIME DEFAULT 0, + EndTime DATETIME DEFAULT 0, + RealEndTime DATETIME DEFAULT 0, + JobTDate BIGINT UNSIGNED DEFAULT 0, + VolSessionId INTEGER UNSIGNED DEFAULT 0, + VolSessionTime INTEGER UNSIGNED DEFAULT 0, + JobFiles INTEGER UNSIGNED DEFAULT 0, + JobBytes BIGINT UNSIGNED DEFAULT 0, + JobErrors INTEGER UNSIGNED DEFAULT 0, + JobMissingFiles INTEGER UNSIGNED DEFAULT 0, + PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0, + FileSetId INTEGER UNSIGNED REFERENCES FileSet DEFAULT 0, + PriorJobId INTEGER UNSIGNED REFERENCES Job DEFAULT 0, + PurgedFiles TINYINT DEFAULT 0, + HasBase TINYINT DEFAULT 0, + PRIMARY KEY(JobId) + ); +CREATE INDEX inx61 ON JobStat (Name); CREATE TABLE Location ( LocationId INTEGER, diff --git a/bacula/src/cats/make_sqlite_tables.in b/bacula/src/cats/make_sqlite_tables.in index 6173a56a59..d32f63e643 100644 --- a/bacula/src/cats/make_sqlite_tables.in +++ b/bacula/src/cats/make_sqlite_tables.in @@ -76,7 +76,33 @@ CREATE TABLE Job ( CREATE INDEX inx6 ON Job (Name); -- Create a table like Job for long term statistics -CREATE TABLE JobStat (LIKE Job); +CREATE TABLE JobStat ( + JobId INTEGER, + Job VARCHAR(128) NOT NULL, + Name VARCHAR(128) NOT NULL, + Type CHAR NOT NULL, + Level CHAR NOT NULL, + ClientId INTEGER REFERENCES Client DEFAULT 0, + JobStatus CHAR NOT NULL, + SchedTime DATETIME NOT NULL, + StartTime DATETIME DEFAULT 0, + EndTime DATETIME DEFAULT 0, + RealEndTime DATETIME DEFAULT 0, + JobTDate BIGINT UNSIGNED DEFAULT 0, + VolSessionId INTEGER UNSIGNED DEFAULT 0, + VolSessionTime INTEGER UNSIGNED DEFAULT 0, + JobFiles INTEGER UNSIGNED DEFAULT 0, + JobBytes BIGINT UNSIGNED DEFAULT 0, + JobErrors INTEGER UNSIGNED DEFAULT 0, + JobMissingFiles INTEGER UNSIGNED DEFAULT 0, + PoolId INTEGER UNSIGNED REFERENCES Pool DEFAULT 0, + FileSetId INTEGER UNSIGNED REFERENCES FileSet DEFAULT 0, + PriorJobId INTEGER UNSIGNED REFERENCES Job DEFAULT 0, + PurgedFiles TINYINT DEFAULT 0, + HasBase TINYINT DEFAULT 0, + PRIMARY KEY(JobId) + ); +CREATE INDEX inx61 ON JobStat (Name); CREATE TABLE Location ( LocationId INTEGER, diff --git a/bacula/src/cats/update_sqlite3_tables.in b/bacula/src/cats/update_sqlite3_tables.in index 12afa17425..b9558f8225 100644 --- a/bacula/src/cats/update_sqlite3_tables.in +++ b/bacula/src/cats/update_sqlite3_tables.in @@ -18,7 +18,33 @@ ${bindir}/${sqlite} $* ${db_name}.db <