1 use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
2 use serde::{Deserialize, Serialize};
4 #[cfg(feature = "full")]
5 use crate::schema::community_block;
7 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
11 diesel(belongs_to(crate::source::community::Community))
13 #[cfg_attr(feature = "full", diesel(table_name = community_block))]
14 pub struct CommunityBlock {
15 pub id: CommunityBlockId,
16 pub person_id: PersonId,
17 pub community_id: CommunityId,
18 pub published: chrono::NaiveDateTime,
21 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
22 #[cfg_attr(feature = "full", diesel(table_name = community_block))]
23 pub struct CommunityBlockForm {
24 pub person_id: PersonId,
25 pub community_id: CommunityId,