DIRACGrid/DIRAC — pull request #1598 by ltomassetti (2013-07-29 15:14:26+00:00)
Title: Changes in the JobLoggingDB.LoggingInfo schema.

Request to be processed AFTER Ubeda's request #1589

Two reasons for the change:
1. StatusTimeOrder field was in overflow, so it has been changed to
DOUBLE(12,3) instead of (11,3)
2. There was no Primary Key (PK) definition. So, a new field has been
added, SeqNum (INTEGER), which is part of the new PK (JobID, SeqNum).
SeqNum is generated by a trigger at every insert and behave as a counter
within a given JobID.

The trigger definition is:
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)

Code has been changed starting from the Ubeda's pull request files
(#1589)

Note: Table definition modification using python dictionary, trigger
definition still in the sql file.