]> Untitled Git - lemmy.git/blobdiff - crates/db_schema/src/source/activity.rs
Adding unique constraint for activity ap_id. Fixes #1878 (#1935)
[lemmy.git] / crates / db_schema / src / source / activity.rs
index cf81ab8c8e2441977f5e7e6ce5f6610088eb8e4f..5bdeb1db27b2ffc99ffc251911fe5362a409593e 100644 (file)
@@ -1,4 +1,4 @@
-use crate::schema::activity;
+use crate::{newtypes::DbUrl, schema::activity};
 use serde_json::Value;
 use std::fmt::Debug;
 
@@ -10,7 +10,7 @@ pub struct Activity {
   pub local: bool,
   pub published: chrono::NaiveDateTime,
   pub updated: Option<chrono::NaiveDateTime>,
-  pub ap_id: Option<String>,
+  pub ap_id: DbUrl,
   pub sensitive: Option<bool>,
 }
 
@@ -18,8 +18,8 @@ pub struct Activity {
 #[table_name = "activity"]
 pub struct ActivityForm {
   pub data: Value,
-  pub local: bool,
+  pub local: Option<bool>,
   pub updated: Option<chrono::NaiveDateTime>,
-  pub ap_id: String,
+  pub ap_id: DbUrl,
   pub sensitive: bool,
 }