2 schema::{community, community_follower, community_moderator, community_person_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<DbUrl>,
26 pub banner: Option<DbUrl>,
27 pub followers_url: DbUrl,
29 pub shared_inbox_url: Option<DbUrl>,
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<DbUrl>,
49 pub banner: Option<DbUrl>,
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<DbUrl>,
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<DbUrl>>,
70 pub banner: Option<Option<DbUrl>>,
71 pub followers_url: Option<DbUrl>,
72 pub inbox_url: Option<DbUrl>,
73 pub shared_inbox_url: Option<Option<DbUrl>>,
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_person_ban"]
96 pub struct CommunityPersonBan {
98 pub community_id: i32,
100 pub published: chrono::NaiveDateTime,
103 #[derive(Insertable, AsChangeset, Clone)]
104 #[table_name = "community_person_ban"]
105 pub struct CommunityPersonBanForm {
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,