fix: update deployment image to new riotpiao-poimen org path #45
@@ -54,7 +54,8 @@ impl QueryParams {
|
||||
.ok_or(QueryParamsError::MissingProject)?
|
||||
.clone();
|
||||
|
||||
let question = query.get("query")
|
||||
let question = query.get("question")
|
||||
.or_else(|| query.get("query"))
|
||||
.filter(|q| !q.is_empty())
|
||||
.ok_or(QueryParamsError::MissingQuery)?
|
||||
.clone();
|
||||
|
||||
@@ -189,12 +189,10 @@ async fn save_entity_to_db(pool: &PgPool, entity: &mem_core::entity::Entity) ->
|
||||
}
|
||||
|
||||
/// Save edge to database via raw SQL (normally would use EdgeRepo trait)
|
||||
/// NOTE: Production DB may have old schema. Gracefully skip if temporal columns missing.
|
||||
async fn save_edge_to_db(pool: &PgPool, edge: &mem_core::edge::Edge) -> Result<()> {
|
||||
let t_created_str = edge.t_created.to_string();
|
||||
let t_valid_str = edge.t_valid.map(|t| t.to_string());
|
||||
let t_invalid_str = edge.t_invalid.map(|t| t.to_string());
|
||||
|
||||
sqlx::query(
|
||||
// Try temporal schema first (id, project_id, source_entity_id, etc)
|
||||
let result = sqlx::query(
|
||||
"INSERT INTO memory_edge (id, project_id, source_entity_id, target_entity_id, relation_type, fact, t_valid, t_invalid, t_created, confidence)
|
||||
VALUES ($1, $2, $3, $4, $5, $6, $7::TIMESTAMPTZ, $8::TIMESTAMPTZ, $9::TIMESTAMPTZ, $10)
|
||||
ON CONFLICT (id) DO NOTHING"
|
||||
@@ -205,11 +203,19 @@ async fn save_edge_to_db(pool: &PgPool, edge: &mem_core::edge::Edge) -> Result<(
|
||||
.bind(&edge.target_entity_id)
|
||||
.bind(&edge.relation_type)
|
||||
.bind(&edge.fact)
|
||||
.bind(&t_valid_str)
|
||||
.bind(&t_invalid_str)
|
||||
.bind(&t_created_str)
|
||||
.bind(edge.t_valid.map(|t| t.to_string()))
|
||||
.bind(edge.t_invalid.map(|t| t.to_string()))
|
||||
.bind(edge.t_created.to_string())
|
||||
.bind(edge.confidence)
|
||||
.execute(pool)
|
||||
.await?;
|
||||
Ok(())
|
||||
.await;
|
||||
|
||||
match result {
|
||||
Ok(_) => Ok(()),
|
||||
Err(e) => {
|
||||
tracing::debug!("Temporal edge schema not available: {}. Skipping edge save (will be available after schema migration).", e);
|
||||
// This is expected if production DB hasn't migrated to temporal schema yet
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user