11from __future__ import annotations
22
33from sqlalchemy import (
4- DateTime ,
54 Double ,
65 Index ,
76 Integer ,
109)
1110from sqlalchemy .orm import declarative_base
1211
12+ from diracx .db .sql .utils .types import SmarterDateTime
13+
1314from ..utils import Column , EnumBackedBool , NullColumn
1415
1516PilotAgentsDBBase = declarative_base ()
@@ -29,8 +30,8 @@ class PilotAgents(PilotAgentsDBBase):
2930 vo = Column ("VO" , String (128 ))
3031 grid_type = Column ("GridType" , String (32 ), default = "LCG" )
3132 benchmark = Column ("BenchMark" , Double , default = 0.0 )
32- submission_time = NullColumn ("SubmissionTime" , DateTime )
33- last_update_time = NullColumn ("LastUpdateTime" , DateTime )
33+ submission_time = NullColumn ("SubmissionTime" , SmarterDateTime )
34+ last_update_time = NullColumn ("LastUpdateTime" , SmarterDateTime )
3435 status = Column ("Status" , String (32 ), default = "Unknown" )
3536 status_reason = Column ("StatusReason" , String (255 ), default = "Unknown" )
3637 accounting_sent = Column ("AccountingSent" , EnumBackedBool (), default = False )
@@ -47,7 +48,7 @@ class JobToPilotMapping(PilotAgentsDBBase):
4748
4849 pilot_id = Column ("PilotID" , Integer , primary_key = True )
4950 job_id = Column ("JobID" , Integer , primary_key = True )
50- start_time = Column ("StartTime" , DateTime )
51+ start_time = Column ("StartTime" , SmarterDateTime )
5152
5253 __table_args__ = (Index ("JobID" , "JobID" ), Index ("PilotID" , "PilotID" ))
5354
0 commit comments