]> 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 7b7f4aba391ef44fe39fa24b9855475e3236a077..5bdeb1db27b2ffc99ffc251911fe5362a409593e 100644 (file)
@@ -1,4 +1,4 @@
-use crate::{schema::activity, DbUrl};
+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<DbUrl>,
+  pub ap_id: DbUrl,
   pub sensitive: Option<bool>,
 }
 
@@ -18,7 +18,7 @@ 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: DbUrl,
   pub sensitive: bool,