From b90f7307bccd43ba906e000a79c7e58e63736480 Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 23 Mar 2024 04:40:39 +0100 Subject: [PATCH] fix: datetime utc, also in likes redo all migrations ehe --- src/migrations/m20240322_000002_add_likes_shares.rs | 2 ++ src/model/like.rs | 1 + src/model/share.rs | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/migrations/m20240322_000002_add_likes_shares.rs b/src/migrations/m20240322_000002_add_likes_shares.rs index 4a535220..24311ea2 100644 --- a/src/migrations/m20240322_000002_add_likes_shares.rs +++ b/src/migrations/m20240322_000002_add_likes_shares.rs @@ -19,6 +19,7 @@ impl MigrationTrait for Migration { ) .col(ColumnDef::new(Likes::Actor).string().not_null()) .col(ColumnDef::new(Likes::Likes).string().not_null()) + .col(ColumnDef::new(Likes::Date).date_time().not_null()) .to_owned() ) .await?; @@ -64,6 +65,7 @@ enum Likes { Id, Actor, Likes, + Date, } #[derive(DeriveIden)] diff --git a/src/model/like.rs b/src/model/like.rs index 6b35512b..2922857d 100644 --- a/src/model/like.rs +++ b/src/model/like.rs @@ -7,6 +7,7 @@ pub struct Model { pub id: i64, pub actor: String, pub likes: String, + pub date: ChronoDateTimeUtc, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)] diff --git a/src/model/share.rs b/src/model/share.rs index 797a981e..405d176f 100644 --- a/src/model/share.rs +++ b/src/model/share.rs @@ -7,7 +7,7 @@ pub struct Model { pub id: i64, pub actor: String, pub shares: String, - pub date: ChronoDateTime, + pub date: ChronoDateTimeUtc, } #[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]