]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/person_block.rs
46920acbf77698bbe7ba4dc3ff6d8926362f1625
[lemmy.git] / crates / db_schema / src / source / person_block.rs
1 use crate::newtypes::{PersonBlockId, PersonId};
2 use serde::{Deserialize, Serialize};
3
4 #[cfg(feature = "full")]
5 use crate::schema::person_block;
6
7 #[derive(Clone, PartialEq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", table_name = "person_block")]
10 pub struct PersonBlock {
11   pub id: PersonBlockId,
12   pub person_id: PersonId,
13   pub target_id: PersonId,
14   pub published: chrono::NaiveDateTime,
15 }
16
17 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
18 #[cfg_attr(feature = "full", table_name = "person_block")]
19 pub struct PersonBlockForm {
20   pub person_id: PersonId,
21   pub target_id: PersonId,
22 }