lemmy/crates/db_schema/src/source/person_mention.rs
2021-02-26 08:49:58 -05:00

22 lines
553 B
Rust

use crate::{schema::person_mention, source::comment::Comment};
use serde::Serialize;
#[derive(Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize)]
#[belongs_to(Comment)]
#[table_name = "person_mention"]
pub struct PersonMention {
pub id: i32,
pub recipient_id: i32,
pub comment_id: i32,
pub read: bool,
pub published: chrono::NaiveDateTime,
}
#[derive(Insertable, AsChangeset)]
#[table_name = "person_mention"]
pub struct PersonMentionForm {
pub recipient_id: i32,
pub comment_id: i32,
pub read: Option<bool>,
}