修复导入本地会话时记录的修改时间不正确
This commit is contained in:
@@ -1,4 +1,3 @@
|
|||||||
use chrono::Utc;
|
|
||||||
use sea_orm::{
|
use sea_orm::{
|
||||||
ActiveModelTrait, ActiveValue::NotSet, ColumnTrait, DatabaseConnection, EntityTrait,
|
ActiveModelTrait, ActiveValue::NotSet, ColumnTrait, DatabaseConnection, EntityTrait,
|
||||||
QueryFilter, Set,
|
QueryFilter, Set,
|
||||||
@@ -74,7 +73,8 @@ pub async fn import_local_conversations(
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
let now = Utc::now();
|
let created_at = summary.started_at;
|
||||||
|
let updated_at = summary.ended_at.unwrap_or(created_at);
|
||||||
let conv = conversation::ActiveModel {
|
let conv = conversation::ActiveModel {
|
||||||
id: NotSet,
|
id: NotSet,
|
||||||
folder_id: Set(folder_id),
|
folder_id: Set(folder_id),
|
||||||
@@ -86,8 +86,8 @@ pub async fn import_local_conversations(
|
|||||||
external_id: Set(Some(summary.id.clone())),
|
external_id: Set(Some(summary.id.clone())),
|
||||||
parent_id: Set(None),
|
parent_id: Set(None),
|
||||||
message_count: Set(summary.message_count as i32),
|
message_count: Set(summary.message_count as i32),
|
||||||
created_at: Set(summary.started_at),
|
created_at: Set(created_at),
|
||||||
updated_at: Set(now),
|
updated_at: Set(updated_at),
|
||||||
deleted_at: Set(None),
|
deleted_at: Set(None),
|
||||||
};
|
};
|
||||||
conv.insert(conn).await?;
|
conv.insert(conn).await?;
|
||||||
|
|||||||
Reference in New Issue
Block a user