From f29d3baeb9c63933e24039043e6f30d92d6bffbf Mon Sep 17 00:00:00 2001 From: alemi Date: Sat, 13 Apr 2024 16:42:49 +0200 Subject: [PATCH] fix: name is nullable, preferredUsername is not --- src/migrations/m20240316_000001_create_table.rs | 6 ++++-- src/model/user.rs | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/migrations/m20240316_000001_create_table.rs b/src/migrations/m20240316_000001_create_table.rs index 9007f65f..8fbcdc72 100644 --- a/src/migrations/m20240316_000001_create_table.rs +++ b/src/migrations/m20240316_000001_create_table.rs @@ -18,11 +18,11 @@ impl MigrationTrait for Migration { ) .col(ColumnDef::new(Users::ActorType).string().not_null()) .col(ColumnDef::new(Users::Domain).string().not_null()) - .col(ColumnDef::new(Users::Name).string().not_null()) + .col(ColumnDef::new(Users::Name).string().null()) .col(ColumnDef::new(Users::Summary).string().null()) .col(ColumnDef::new(Users::Image).string().null()) .col(ColumnDef::new(Users::Icon).string().null()) - .col(ColumnDef::new(Users::PreferredUsername).string().null()) + .col(ColumnDef::new(Users::PreferredUsername).string().not_null()) .col(ColumnDef::new(Users::Inbox).string().null()) .col(ColumnDef::new(Users::SharedInbox).string().null()) .col(ColumnDef::new(Users::Outbox).string().null()) @@ -30,6 +30,7 @@ impl MigrationTrait for Migration { .col(ColumnDef::new(Users::Followers).string().null()) .col(ColumnDef::new(Users::FollowingCount).integer().not_null().default(0)) .col(ColumnDef::new(Users::FollowersCount).integer().not_null().default(0)) + // .col(ColumnDef::new(Users::StatusesCount).integer().not_null().default(0)) .col(ColumnDef::new(Users::PublicKey).string().not_null()) .col(ColumnDef::new(Users::PrivateKey).string().null()) .col(ColumnDef::new(Users::Created).date_time().not_null()) @@ -125,6 +126,7 @@ enum Users { FollowingCount, Followers, FollowersCount, + // StatusesCount, PublicKey, PrivateKey, Created, diff --git a/src/model/user.rs b/src/model/user.rs index 233481d6..c8d8fc1f 100644 --- a/src/model/user.rs +++ b/src/model/user.rs @@ -24,6 +24,7 @@ pub struct Model { pub following_count: i64, pub followers_count: i64, + // pub statuses_count: i64, pub public_key: String, pub private_key: Option,