1 use crate::newtypes::{CommunityBlockId, CommunityId, PersonId};
2 #[cfg(feature = "full")]
3 use crate::schema::community_block;
4 use serde::{Deserialize, Serialize};
6 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
7 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
10 diesel(belongs_to(crate::source::community::Community))
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,
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,