23 lines
681 B
Rust
23 lines
681 B
Rust
use crate::{DateTimeUtc, MessageId, ProjectId, RoomId, UserId};
|
|
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
/// User-saved room messages scoped to a project.
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "project_message_favorite")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub uid: Uuid,
|
|
pub project: ProjectId,
|
|
pub room: RoomId,
|
|
pub message: MessageId,
|
|
#[sea_orm(column_name = "user_uuid")]
|
|
pub user: UserId,
|
|
pub created_at: DateTimeUtc,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|