lemmy/crates/db_schema/src/source/person_mention.rs

28 lines
679 B
Rust
Raw Normal View History

use crate::{
2021-10-16 13:33:38 +00:00
newtypes::{CommentId, PersonId, PersonMentionId},
schema::person_mention,
source::comment::Comment,
};
use serde::{Deserialize, Serialize};
#[derive(
Clone, Queryable, Associations, Identifiable, PartialEq, Debug, Serialize, Deserialize,
)]
#[belongs_to(Comment)]
2021-02-26 13:49:58 +00:00
#[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)]
2021-02-26 13:49:58 +00:00
#[table_name = "person_mention"]
pub struct PersonMentionForm {
pub recipient_id: PersonId,
pub comment_id: CommentId,
pub read: Option<bool>,
}