change: Rename in_on col of incoming_chat table to received_timestamp

Signed-off-by: Awiteb <a@4rs.nl>
This commit is contained in:
Awiteb 2024-07-28 11:07:00 +03:00
parent c8693eeb3e
commit d1ca5c0a48
Signed by: awiteb
GPG key ID: 3F6B55640AA6682F
3 changed files with 8 additions and 8 deletions

View file

@ -43,7 +43,7 @@ impl IncomingChatExt for DatabaseConnection {
IncomingChatEntity::insert(IncomingChatActiveModel {
recipient_id: Set(recipient.id),
sender: Set(*sender),
in_on: Set(Utc::now()),
received_timestamp: Set(Utc::now()),
..Default::default()
})
.on_conflict(

View file

@ -39,7 +39,7 @@ pub struct Model {
/// This will be `None` if it is chat request, otherwise `bool`
pub accepted_response: Option<bool>,
/// The timestamp of the request, when it was received
pub in_on: chrono::DateTime<Utc>,
pub received_timestamp: chrono::DateTime<Utc>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]

View file

@ -65,7 +65,7 @@ impl MigrationTrait for Migration {
.default(Option::<bool>::None),
)
.col(
ColumnDef::new(IncomingChat::InOn)
ColumnDef::new(IncomingChat::ReceivedTimestamp)
.timestamp_with_time_zone()
.not_null(),
)
@ -97,5 +97,5 @@ enum IncomingChat {
Sender,
/// Whether the chat response accepted or not
AcceptedResponse,
InOn,
ReceivedTimestamp,
}