]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/person_mention.rs
Diesel 2.0.0 upgrade (#2452)
[lemmy.git] / crates / db_schema / src / source / person_mention.rs
1 use crate::newtypes::{CommentId, PersonId, PersonMentionId};
2 use serde::{Deserialize, Serialize};
3
4 #[cfg(feature = "full")]
5 use crate::schema::person_mention;
6
7 #[derive(Clone, PartialEq, Eq, Debug, Serialize, Deserialize)]
8 #[cfg_attr(feature = "full", derive(Queryable, Associations, Identifiable))]
9 #[cfg_attr(feature = "full", diesel(belongs_to(crate::source::comment::Comment)))]
10 #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
11 pub struct PersonMention {
12   pub id: PersonMentionId,
13   pub recipient_id: PersonId,
14   pub comment_id: CommentId,
15   pub read: bool,
16   pub published: chrono::NaiveDateTime,
17 }
18
19 #[cfg_attr(feature = "full", derive(Insertable, AsChangeset))]
20 #[cfg_attr(feature = "full", diesel(table_name = person_mention))]
21 pub struct PersonMentionForm {
22   pub recipient_id: PersonId,
23   pub comment_id: CommentId,
24   pub read: Option<bool>,
25 }