2 schema::{community, community_follower, community_moderator, community_user_ban},
7 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
8 #[table_name = "community"]
13 pub description: Option<String>,
16 pub published: chrono::NaiveDateTime,
17 pub updated: Option<chrono::NaiveDateTime>,
22 pub private_key: Option<String>,
23 pub public_key: Option<String>,
24 pub last_refreshed_at: chrono::NaiveDateTime,
25 pub icon: Option<String>,
26 pub banner: Option<String>,
27 pub followers_url: Url,
29 pub shared_inbox_url: Option<Url>,
32 /// A safe representation of community, without the sensitive info
33 #[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
34 #[table_name = "community"]
35 pub struct CommunitySafe {
39 pub description: Option<String>,
42 pub published: chrono::NaiveDateTime,
43 pub updated: Option<chrono::NaiveDateTime>,
48 pub icon: Option<String>,
49 pub banner: Option<String>,
52 #[derive(Insertable, AsChangeset, Debug)]
53 #[table_name = "community"]
54 pub struct CommunityForm {
57 pub description: Option<String>,
59 pub removed: Option<bool>,
60 pub published: Option<chrono::NaiveDateTime>,
61 pub updated: Option<chrono::NaiveDateTime>,
62 pub deleted: Option<bool>,
64 pub actor_id: Option<Url>,
66 pub private_key: Option<String>,
67 pub public_key: Option<String>,
68 pub last_refreshed_at: Option<chrono::NaiveDateTime>,
69 pub icon: Option<Option<String>>,
70 pub banner: Option<Option<String>>,
71 pub followers_url: Option<Url>,
72 pub inbox_url: Option<Url>,
73 pub shared_inbox_url: Option<Option<Url>>,
76 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
77 #[belongs_to(Community)]
78 #[table_name = "community_moderator"]
79 pub struct CommunityModerator {
81 pub community_id: i32,
83 pub published: chrono::NaiveDateTime,
86 #[derive(Insertable, AsChangeset, Clone)]
87 #[table_name = "community_moderator"]
88 pub struct CommunityModeratorForm {
89 pub community_id: i32,
93 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
94 #[belongs_to(Community)]
95 #[table_name = "community_user_ban"]
96 pub struct CommunityUserBan {
98 pub community_id: i32,
100 pub published: chrono::NaiveDateTime,
103 #[derive(Insertable, AsChangeset, Clone)]
104 #[table_name = "community_user_ban"]
105 pub struct CommunityUserBanForm {
106 pub community_id: i32,
110 #[derive(Identifiable, Queryable, Associations, PartialEq, Debug)]
111 #[belongs_to(Community)]
112 #[table_name = "community_follower"]
113 pub struct CommunityFollower {
115 pub community_id: i32,
117 pub published: chrono::NaiveDateTime,
118 pub pending: Option<bool>,
121 #[derive(Insertable, AsChangeset, Clone)]
122 #[table_name = "community_follower"]
123 pub struct CommunityFollowerForm {
124 pub community_id: i32,