X-Git-Url: http://these/git/?a=blobdiff_plain;f=crates%2Fdb_schema%2Fsrc%2Fsource%2Factivity.rs;h=85b193f51f525fcbab2df076eca8be2c87f225cc;hb=e9e76549a88cfbdab36f00d302cceabcaaa24f4c;hp=ced8f3be49c95a87e7119515db4cece71b5fbe64;hpb=4c8f2e976effe381d4ea1914462c43242a8c64fd;p=lemmy.git diff --git a/crates/db_schema/src/source/activity.rs b/crates/db_schema/src/source/activity.rs index ced8f3be..85b193f5 100644 --- a/crates/db_schema/src/source/activity.rs +++ b/crates/db_schema/src/source/activity.rs @@ -1,25 +1,28 @@ -use crate::{schema::activity, DbUrl}; +use crate::{newtypes::DbUrl, schema::sent_activity}; use serde_json::Value; use std::fmt::Debug; -#[derive(Queryable, Identifiable, PartialEq, Debug)] -#[table_name = "activity"] -pub struct Activity { - pub id: i32, +#[derive(PartialEq, Eq, Debug, Queryable)] +#[diesel(table_name = sent_activity)] +pub struct SentActivity { + pub id: i64, + pub ap_id: DbUrl, pub data: Value, - pub local: bool, + pub sensitive: bool, pub published: chrono::NaiveDateTime, - pub updated: Option, - pub ap_id: Option, - pub sensitive: Option, } - -#[derive(Insertable, AsChangeset)] -#[table_name = "activity"] -pub struct ActivityForm { - pub data: Value, - pub local: Option, - pub updated: Option, +#[derive(Insertable)] +#[diesel(table_name = sent_activity)] +pub struct SentActivityForm { pub ap_id: DbUrl, + pub data: Value, pub sensitive: bool, } + +#[derive(PartialEq, Eq, Debug, Queryable)] +#[diesel(table_name = received_activity)] +pub struct ReceivedActivity { + pub id: i64, + pub ap_id: DbUrl, + pub published: chrono::NaiveDateTime, +}