lemmy/crates/db_schema/src/source/person_mention.rs
2021-03-18 16:25:21 -04:00

28 lines
638 B
Rust

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