add field created_at to db::Message struct
All checks were successful
Build && Deploy / cargo build (push) Successful in 1m3s
All checks were successful
Build && Deploy / cargo build (push) Successful in 1m3s
This commit is contained in:
parent
4b91108d1a
commit
9dfa7c52d9
@ -7,7 +7,7 @@ pub mod raw_calls;
|
||||
use std::time::Duration;
|
||||
|
||||
use async_trait::async_trait;
|
||||
use chrono::{DateTime, Utc};
|
||||
use chrono::{DateTime, FixedOffset, Local, Utc};
|
||||
use enum_stringify::EnumStringify;
|
||||
use futures::stream::TryStreamExt;
|
||||
|
||||
@ -108,6 +108,7 @@ pub struct Message {
|
||||
pub message_id: i64,
|
||||
pub token: String,
|
||||
pub variant: Option<String>,
|
||||
pub created_at: DateTime<FixedOffset>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
@ -343,7 +344,10 @@ pub trait CallDB {
|
||||
"message_id": messageid as i64
|
||||
},
|
||||
doc! {
|
||||
"$set": { "token": literal }
|
||||
"$set": {
|
||||
"token": literal,
|
||||
"created_at": Into::<DateTime<FixedOffset>>::into(Local::now()),
|
||||
}
|
||||
},
|
||||
)
|
||||
.upsert(true)
|
||||
@ -369,7 +373,11 @@ pub trait CallDB {
|
||||
"message_id": messageid as i64
|
||||
},
|
||||
doc! {
|
||||
"$set": { "token": literal, "variant": variant }
|
||||
"$set": {
|
||||
"token": literal,
|
||||
"variant": variant,
|
||||
"created_at": Into::<DateTime<FixedOffset>>::into(Local::now()),
|
||||
}
|
||||
},
|
||||
)
|
||||
.upsert(true)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user