Add follower and following count fields to user and person models

This commit is contained in:
aprilthepink 2024-04-18 19:09:10 +02:00
parent b5c9c2b9e6
commit 8a4f5b795c
2 changed files with 4 additions and 0 deletions

View file

@ -79,6 +79,8 @@ async fn main() -> actix_web::Result<(), anyhow::Error> {
public_key: Set(keypair.public_key.clone()),
private_key: Set(Some(keypair.private_key.clone())),
last_refreshed_at: Set(chrono::offset::Utc::now()),
follower_count: Set(0),
following_count: Set(0),
url: Set(ap_id.to_string()),
local: Set(true),
..Default::default()

View file

@ -129,6 +129,8 @@ impl Object for user::Model {
local: Set(false),
summary: Set(json.summary),
url: Set(json.url.to_string()),
follower_count: Set(0),
following_count: Set(0),
..Default::default()
};
let model = model.insert(_data.database_connection.as_ref()).await;