]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/community_block.rs
User / community blocking. Fixes #426 (#1604)
[lemmy.git] / crates / db_schema / src / source / community_block.rs
1 use crate::{
2   schema::community_block,
3   source::community::Community,
4   CommunityBlockId,
5   CommunityId,
6   PersonId,
7 };
8 use serde::Serialize;
9
10 #[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
11 #[table_name = "community_block"]
12 #[belongs_to(Community)]
13 pub struct CommunityBlock {
14   pub id: CommunityBlockId,
15   pub person_id: PersonId,
16   pub community_id: CommunityId,
17   pub published: chrono::NaiveDateTime,
18 }
19
20 #[derive(Insertable, AsChangeset)]
21 #[table_name = "community_block"]
22 pub struct CommunityBlockForm {
23   pub person_id: PersonId,
24   pub community_id: CommunityId,
25 }