]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/community_block.rs
Add cargo feature for building lemmy_api_common with mininum deps (#2243)
[lemmy.git] / crates / db_schema / src / source / community_block.rs
1 use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
2 use serde::{Deserialize, Serialize};
3
4 #[cfg(feature = "full")]
5 use crate::schema::community_block;
6
7 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", belongs_to(crate::source::community::Community))]
10 #[cfg_attr(feature = "full", table_name = "community_block")]
11 pub struct CommunityBlock {
12   pub id: CommunityBlockId,
13   pub person_id: PersonId,
14   pub community_id: CommunityId,
15   pub published: chrono::NaiveDateTime,
16 }
17
18 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
19 #[cfg_attr(feature = "full", table_name = "community_block")]
20 pub struct CommunityBlockForm {
21   pub person_id: PersonId,
22   pub community_id: CommunityId,
23 }