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,
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,
BEGIN TRANSACTION;
-- 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);
UPDATE Version SET VersionId=11;
BEGIN TRANSACTION;
-- 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);
UPDATE Version SET VersionId=11;