]> Untitled Git - lemmy.git/blob - lemmy_db_schema/src/source/comment_report.rs
Merge pull request #1328 from LemmyNet/move_views_to_diesel
[lemmy.git] / lemmy_db_schema / src / source / comment_report.rs
1 use crate::{schema::comment_report, source::comment::Comment};
2 use serde::{Deserialize, Serialize};
3
4 #[derive(
5   Identifiable, Queryable, Associations, PartialEq, Serialize, Deserialize, Debug, Clone,
6 )]
7 #[belongs_to(Comment)]
8 #[table_name = "comment_report"]
9 pub struct CommentReport {
10   pub id: i32,
11   pub creator_id: i32,
12   pub comment_id: i32,
13   pub original_comment_text: String,
14   pub reason: String,
15   pub resolved: bool,
16   pub resolver_id: Option<i32>,
17   pub published: chrono::NaiveDateTime,
18   pub updated: Option<chrono::NaiveDateTime>,
19 }
20
21 #[derive(Insertable, AsChangeset, Clone)]
22 #[table_name = "comment_report"]
23 pub struct CommentReportForm {
24   pub creator_id: i32,
25   pub comment_id: i32,
26   pub original_comment_text: String,
27   pub reason: String,
28 }