]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/community_block.rs
add enable_federated_downvotes site option
[lemmy.git] / crates / db_schema / src / source / community_block.rs
1 use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
2 #[cfg(feature = "full")]
3 use crate::schema::community_block;
4 use serde::{Deserialize, Serialize};
5
6 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
7 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
8 #[cfg_attr(
9   feature = "full",
10   diesel(belongs_to(crate::source::community::Community))
11 )]
12 #[cfg_attr(feature = "full", diesel(table_name = community_block))]
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 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
21 #[cfg_attr(feature = "full", diesel(table_name = community_block))]
22 pub struct CommunityBlockForm {
23   pub person_id: PersonId,
24   pub community_id: CommunityId,
25 }