@@ -73,11 +73,11 @@ CREATE TABLE `PilotOutput` (
7373DROP TABLE IF EXISTS ` PilotsHistorySummary` ;
7474CREATE TABLE `PilotsHistorySummary ` (
7575 ` GridSite` VARCHAR (128 ),
76- ` DestinationSite ` VARCHAR (128 ),
76+ ` ComputingElement ` VARCHAR (128 ),
7777 ` Status` VARCHAR (32 ),
7878 ` VO` VARCHAR (64 ),
7979 ` PilotCount` INT ,
80- PRIMARY KEY (` GridSite` ,` DestinationSite ` ,` Status` , ` VO` )
80+ PRIMARY KEY (` GridSite` ,` ComputingElement ` ,` Status` , ` VO` )
8181) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4;
8282
8383
@@ -89,7 +89,7 @@ CREATE TRIGGER trg_PilotAgents_insert
8989AFTER INSERT ON PilotAgents
9090FOR EACH ROW
9191BEGIN
92- INSERT INTO PilotsHistorySummary (GridSite, DestinationSite , Status, VO, PilotCount)
92+ INSERT INTO PilotsHistorySummary (GridSite, ComputingElement , Status, VO, PilotCount)
9393 VALUES (NEW .GridSite , NEW .DestinationSite , NEW .Status , NEW .VO , 1 )
9494 ON DUPLICATE KEY UPDATE PilotCount = PilotCount + 1 ;
9595END;
@@ -102,15 +102,15 @@ BEGIN
102102 UPDATE PilotsHistorySummary
103103 SET PilotCount = PilotCount - 1
104104 WHERE GridSite = OLD .GridSite
105- AND DestinationSite = OLD .DestinationSite
105+ AND ComputingElement = OLD .DestinationSite
106106 AND Status = OLD .Status
107107 AND VO = OLD .VO ;
108108
109109 -- Remove zero rows
110110 DELETE FROM PilotsHistorySummary
111111 WHERE PilotCount = 0
112112 AND GridSite = OLD .GridSite
113- AND DestinationSite = OLD .DestinationSite
113+ AND ComputingElement = OLD .DestinationSite
114114 AND Status = OLD .Status
115115 AND VO = OLD .VO ;
116116END;
@@ -126,15 +126,15 @@ BEGIN
126126 UPDATE PilotsHistorySummary
127127 SET PilotCount = PilotCount - 1
128128 WHERE GridSite = OLD .GridSite
129- AND DestinationSite = OLD .DestinationSite
129+ AND ComputingElement = OLD .DestinationSite
130130 AND Status = OLD .Status
131131 AND VO = OLD .VO ;
132132
133133 -- Delete row if count drops to zero
134134 DELETE FROM PilotsHistorySummary WHERE PilotCount = 0 ;
135135
136136 -- Increase count for new status
137- INSERT INTO PilotsHistorySummary (GridSite, DestinationSite , Status, VO, PilotCount)
137+ INSERT INTO PilotsHistorySummary (GridSite, ComputingElement , Status, VO, PilotCount)
138138 VALUES (NEW .GridSite , NEW .DestinationSite , NEW .Status , NEW .VO , 1 )
139139 ON DUPLICATE KEY UPDATE PilotCount = PilotCount + 1 ;
140140
0 commit comments