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