@@ -73,11 +73,11 @@ CREATE TABLE `PilotOutput` (
73
73
DROP TABLE IF EXISTS ` PilotsHistorySummary` ;
74
74
CREATE TABLE `PilotsHistorySummary ` (
75
75
` GridSite` VARCHAR (128 ),
76
- ` DestinationSite ` VARCHAR (128 ),
76
+ ` ComputingElement ` VARCHAR (128 ),
77
77
` Status` VARCHAR (32 ),
78
78
` VO` VARCHAR (64 ),
79
79
` PilotCount` INT ,
80
- PRIMARY KEY (` GridSite` ,` DestinationSite ` ,` Status` , ` VO` )
80
+ PRIMARY KEY (` GridSite` ,` ComputingElement ` ,` Status` , ` VO` )
81
81
) ENGINE= InnoDB DEFAULT CHARSET= utf8mb4;
82
82
83
83
@@ -89,7 +89,7 @@ CREATE TRIGGER trg_PilotAgents_insert
89
89
AFTER INSERT ON PilotAgents
90
90
FOR EACH ROW
91
91
BEGIN
92
- INSERT INTO PilotsHistorySummary (GridSite, DestinationSite , Status, VO, PilotCount)
92
+ INSERT INTO PilotsHistorySummary (GridSite, ComputingElement , Status, VO, PilotCount)
93
93
VALUES (NEW .GridSite , NEW .DestinationSite , NEW .Status , NEW .VO , 1 )
94
94
ON DUPLICATE KEY UPDATE PilotCount = PilotCount + 1 ;
95
95
END;
@@ -102,15 +102,15 @@ BEGIN
102
102
UPDATE PilotsHistorySummary
103
103
SET PilotCount = PilotCount - 1
104
104
WHERE GridSite = OLD .GridSite
105
- AND DestinationSite = OLD .DestinationSite
105
+ AND ComputingElement = OLD .DestinationSite
106
106
AND Status = OLD .Status
107
107
AND VO = OLD .VO ;
108
108
109
109
-- Remove zero rows
110
110
DELETE FROM PilotsHistorySummary
111
111
WHERE PilotCount = 0
112
112
AND GridSite = OLD .GridSite
113
- AND DestinationSite = OLD .DestinationSite
113
+ AND ComputingElement = OLD .DestinationSite
114
114
AND Status = OLD .Status
115
115
AND VO = OLD .VO ;
116
116
END;
@@ -126,15 +126,15 @@ BEGIN
126
126
UPDATE PilotsHistorySummary
127
127
SET PilotCount = PilotCount - 1
128
128
WHERE GridSite = OLD .GridSite
129
- AND DestinationSite = OLD .DestinationSite
129
+ AND ComputingElement = OLD .DestinationSite
130
130
AND Status = OLD .Status
131
131
AND VO = OLD .VO ;
132
132
133
133
-- Delete row if count drops to zero
134
134
DELETE FROM PilotsHistorySummary WHERE PilotCount = 0 ;
135
135
136
136
-- Increase count for new status
137
- INSERT INTO PilotsHistorySummary (GridSite, DestinationSite , Status, VO, PilotCount)
137
+ INSERT INTO PilotsHistorySummary (GridSite, ComputingElement , Status, VO, PilotCount)
138
138
VALUES (NEW .GridSite , NEW .DestinationSite , NEW .Status , NEW .VO , 1 )
139
139
ON DUPLICATE KEY UPDATE PilotCount = PilotCount + 1 ;
140
140
0 commit comments