Mysql related functionality finished
This commit is contained in:
47
models/execution/model_execution.py
Normal file
47
models/execution/model_execution.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from sqlalchemy import Integer, String, DateTime, Column, JSON, Boolean
|
||||
from sqlalchemy.orm import declarative_base
|
||||
|
||||
base_execution = declarative_base()
|
||||
|
||||
|
||||
class ExecutionModel(base_execution):
|
||||
__tablename__ = 'execution'
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
started_at = Column(DateTime, nullable=True)
|
||||
stopped_at = Column(DateTime, nullable=True)
|
||||
execution_status = Column(String(50), nullable=True)
|
||||
grafana_url = Column(String(1000), nullable=True)
|
||||
squash_url = Column(String(1000), nullable=True)
|
||||
test_name = Column(String(500), nullable=True)
|
||||
hurricane_project_id = Column(String(100), nullable=True)
|
||||
landslide_execution_id = Column(String(50), nullable=True)
|
||||
hurricane_test_id = Column(String(100), nullable=True)
|
||||
action_properties = Column(JSON, nullable=True)
|
||||
parameters = Column(JSON, nullable=True)
|
||||
parameters_update = Column(JSON, nullable=True)
|
||||
queue_uuid = Column(String(36), nullable=True)
|
||||
max_duration = Column(Integer, nullable=True)
|
||||
str_id = Column(Integer, nullable=True)
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
def asdict(self):
|
||||
return {"id": self.id,
|
||||
"started_at": self.started_at,
|
||||
"stopped_at": self.stopped_at,
|
||||
"execution_status": self.execution_status,
|
||||
"grafana_url": self.grafana_url,
|
||||
"squash_url": self.squash_url,
|
||||
"test_name": self.test_name,
|
||||
"hurricane_project_id": self.hurricane_project_id,
|
||||
"landslide_execution_id": self.landslide_execution_id,
|
||||
"hurricane_test_id": self.hurricane_test_id,
|
||||
"action_properties": self.action_properties,
|
||||
"parameters": self.parameters,
|
||||
"parameters_update": self.parameters_update,
|
||||
"queue_uuid": self.queue_uuid,
|
||||
"max_duration": self.max_duration,
|
||||
"str_id": self.str_id
|
||||
}
|
||||
Reference in New Issue
Block a user