Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v6r10] DBs definition: portings from integration #1724

Merged
merged 1 commit into from
Nov 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion TransformationSystem/DB/TransformationDB.sql
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ CREATE TABLE DataFiles (
LFN VARCHAR(255) UNIQUE,
Status varchar(32) DEFAULT 'AprioriGood',
INDEX (Status),
PRIMARY KEY (FileID, LFN)
PRIMARY KEY (FileID)
);

13 changes: 11 additions & 2 deletions WorkloadManagementSystem/DB/JobLoggingDB.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,21 @@ USE JobLoggingDB;
DROP TABLE IF EXISTS LoggingInfo;
CREATE TABLE LoggingInfo (
JobID INTEGER NOT NULL,
SeqNum INTEGER NOT NULL DEFAULT 0,
Status VARCHAR(32) NOT NULL DEFAULT '',
MinorStatus VARCHAR(128) NOT NULL DEFAULT '',
ApplicationStatus varchar(256) NOT NULL DEFAULT '',
StatusTime DATETIME NOT NULL ,
StatusTimeOrder DOUBLE(11,3) NOT NULL,
StatusTimeOrder DOUBLE(12,3) NOT NULL,
StatusSource VARCHAR(32) NOT NULL DEFAULT 'Unknown',
INDEX (JobID)
PRIMARY KEY (JobID, SeqNum)
) ENGINE = InnoDB;

-- -----------------------------------------------------------------------------
--
-- Trigger to manage the new LoggingInfo structure: SeqNum is a sequential number within the same JobID
-- the trigger generates a proper sequence for each JobID
--

CREATE TRIGGER SeqNumGenerator BEFORE INSERT ON LoggingInfo
FOR EACH ROW SET NEW.SeqNum= (SELECT IFNULL(MAX(SeqNum) + 1,1) FROM LoggingInfo WHERE JobID=NEW.JobID);