2 schema::{post, post_like, post_read, post_saved},
10 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
11 #[table_name = "post"]
15 pub url: Option<DbUrl>,
16 pub body: Option<String>,
17 pub creator_id: PersonId,
18 pub community_id: CommunityId,
21 pub published: chrono::NaiveDateTime,
22 pub updated: Option<chrono::NaiveDateTime>,
26 pub embed_title: Option<String>,
27 pub embed_description: Option<String>,
28 pub embed_html: Option<String>,
29 pub thumbnail_url: Option<DbUrl>,
34 #[derive(Insertable, AsChangeset, Default)]
35 #[table_name = "post"]
38 pub url: Option<DbUrl>,
39 pub body: Option<String>,
40 pub creator_id: PersonId,
41 pub community_id: CommunityId,
42 pub removed: Option<bool>,
43 pub locked: Option<bool>,
44 pub published: Option<chrono::NaiveDateTime>,
45 pub updated: Option<chrono::NaiveDateTime>,
46 pub deleted: Option<bool>,
48 pub stickied: Option<bool>,
49 pub embed_title: Option<String>,
50 pub embed_description: Option<String>,
51 pub embed_html: Option<String>,
52 pub thumbnail_url: Option<DbUrl>,
53 pub ap_id: Option<DbUrl>,
54 pub local: Option<bool>,
57 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
59 #[table_name = "post_like"]
63 pub person_id: PersonId,
65 pub published: chrono::NaiveDateTime,
68 #[derive(Insertable, AsChangeset, Clone)]
69 #[table_name = "post_like"]
70 pub struct PostLikeForm {
72 pub person_id: PersonId,
76 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
78 #[table_name = "post_saved"]
79 pub struct PostSaved {
82 pub person_id: PersonId,
83 pub published: chrono::NaiveDateTime,
86 #[derive(Insertable, AsChangeset)]
87 #[table_name = "post_saved"]
88 pub struct PostSavedForm {
90 pub person_id: PersonId,
93 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
95 #[table_name = "post_read"]
99 pub person_id: PersonId,
100 pub published: chrono::NaiveDateTime,
103 #[derive(Insertable, AsChangeset)]
104 #[table_name = "post_read"]
105 pub struct PostReadForm {
107 pub person_id: PersonId,