]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/source/user.rs
Use Url type for ap_id fields in database (fixes #1364)
[lemmy.git] / crates / db_schema / src / source / user.rs
index f9dc0a59ad3be37479003b2e45b9ff5b661f7321..f702c84bbe65757bb325babd7bb012540cd160f1 100644 (file)
@@ -1,4 +1,7 @@
-use crate::schema::{user_, user_alias_1, user_alias_2};
+use crate::{
+  schema::{user_, user_alias_1, user_alias_2},
+  Url,
+};
 use serde::Serialize;
 
 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
@@ -22,7 +25,7 @@ pub struct User_ {
   pub show_avatars: bool,
   pub send_notifications_to_email: bool,
   pub matrix_user_id: Option<String>,
-  pub actor_id: String,
+  pub actor_id: Url,
   pub bio: Option<String>,
   pub local: bool,
   pub private_key: Option<String>,
@@ -45,7 +48,7 @@ pub struct UserSafe {
   pub published: chrono::NaiveDateTime,
   pub updated: Option<chrono::NaiveDateTime>,
   pub matrix_user_id: Option<String>,
-  pub actor_id: String,
+  pub actor_id: Url,
   pub bio: Option<String>,
   pub local: bool,
   pub banner: Option<String>,
@@ -73,7 +76,7 @@ pub struct UserSafeSettings {
   pub show_avatars: bool,
   pub send_notifications_to_email: bool,
   pub matrix_user_id: Option<String>,
-  pub actor_id: String,
+  pub actor_id: Url,
   pub bio: Option<String>,
   pub local: bool,
   pub last_refreshed_at: chrono::NaiveDateTime,
@@ -102,7 +105,7 @@ pub struct UserAlias1 {
   pub show_avatars: bool,
   pub send_notifications_to_email: bool,
   pub matrix_user_id: Option<String>,
-  pub actor_id: String,
+  pub actor_id: Url,
   pub bio: Option<String>,
   pub local: bool,
   pub private_key: Option<String>,
@@ -124,7 +127,7 @@ pub struct UserSafeAlias1 {
   pub published: chrono::NaiveDateTime,
   pub updated: Option<chrono::NaiveDateTime>,
   pub matrix_user_id: Option<String>,
-  pub actor_id: String,
+  pub actor_id: Url,
   pub bio: Option<String>,
   pub local: bool,
   pub banner: Option<String>,
@@ -152,7 +155,7 @@ pub struct UserAlias2 {
   pub show_avatars: bool,
   pub send_notifications_to_email: bool,
   pub matrix_user_id: Option<String>,
-  pub actor_id: String,
+  pub actor_id: Url,
   pub bio: Option<String>,
   pub local: bool,
   pub private_key: Option<String>,
@@ -174,7 +177,7 @@ pub struct UserSafeAlias2 {
   pub published: chrono::NaiveDateTime,
   pub updated: Option<chrono::NaiveDateTime>,
   pub matrix_user_id: Option<String>,
-  pub actor_id: String,
+  pub actor_id: Url,
   pub bio: Option<String>,
   pub local: bool,
   pub banner: Option<String>,
@@ -201,7 +204,7 @@ pub struct UserForm {
   pub show_avatars: bool,
   pub send_notifications_to_email: bool,
   pub matrix_user_id: Option<Option<String>>,
-  pub actor_id: Option<String>,
+  pub actor_id: Option<Url>,
   pub bio: Option<Option<String>>,
   pub local: bool,
   pub private_key: Option<String>,