]> Untitled Git - lemmy.git/blob - crates/db_schema/src/source/user_mention.rs
Merge pull request #1328 from LemmyNet/move_views_to_diesel
[lemmy.git] / crates / db_schema / src / source / user_mention.rs
1 use crate::{schema::user_mention, source::comment::Comment};
2 use serde::Serialize;
3
4 #[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
5 #[belongs_to(Comment)]
6 #[table_name = "user_mention"]
7 pub struct UserMention {
8   pub id: i32,
9   pub recipient_id: i32,
10   pub comment_id: i32,
11   pub read: bool,
12   pub published: chrono::NaiveDateTime,
13 }
14
15 #[derive(Insertable, AsChangeset)]
16 #[table_name = "user_mention"]
17 pub struct UserMentionForm {
18   pub recipient_id: i32,
19   pub comment_id: i32,
20   pub read: Option<bool>,
21 }