fix: add visible columnt to .sql init script
This commit is contained in:
@@ -7,5 +7,6 @@ CREATE TABLE processed_agent_data (
|
||||
z FLOAT,
|
||||
latitude FLOAT,
|
||||
longitude FLOAT,
|
||||
timestamp TIMESTAMP
|
||||
);
|
||||
timestamp TIMESTAMP,
|
||||
visible BOOLEAN
|
||||
);
|
||||
|
||||
@@ -30,8 +30,8 @@ processed_agent_data = Table(
|
||||
Column("z", Float),
|
||||
Column("latitude", Float),
|
||||
Column("longitude", Float),
|
||||
Column("visible", Boolean),
|
||||
Column("timestamp", DateTime),
|
||||
Column("visible", Boolean),
|
||||
)
|
||||
|
||||
# WebSocket subscriptions
|
||||
@@ -82,8 +82,8 @@ def ProcessedAgentData_to_td(data: List[ProcessedAgentData]):
|
||||
"z": item.agent_data.accelerometer.z,
|
||||
"latitude": item.agent_data.gps.latitude,
|
||||
"longitude": item.agent_data.gps.longitude,
|
||||
"visible": True,
|
||||
"timestamp": item.agent_data.timestamp,
|
||||
"visible": True,
|
||||
}
|
||||
for item in data
|
||||
]
|
||||
@@ -173,6 +173,7 @@ def update_processed_agent_data(processed_agent_data_id: int, data: ProcessedAge
|
||||
z=data.agent_data.accelerometer.z,
|
||||
latitude=data.agent_data.gps.latitude,
|
||||
longitude=data.agent_data.gps.longitude,
|
||||
visible=data.visible,
|
||||
timestamp=data.agent_data.timestamp,
|
||||
)
|
||||
)
|
||||
|
||||
@@ -12,8 +12,8 @@ class ProcessedAgentDataInDB(BaseModel):
|
||||
z: float
|
||||
latitude: float
|
||||
longitude: float
|
||||
visible: bool
|
||||
timestamp: datetime
|
||||
visible: bool
|
||||
|
||||
|
||||
# FastAPI models
|
||||
@@ -50,3 +50,4 @@ class AgentData(BaseModel):
|
||||
class ProcessedAgentData(BaseModel):
|
||||
road_state: str
|
||||
agent_data: AgentData
|
||||
visible: bool
|
||||
|
||||
Reference in New Issue
Block a user