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