main
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "issue_reaction")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(unique_key = "issue_user_emoji")]
pub issue_id: Option<Uuid>,
#[sea_orm(unique_key = "comment_user_emoji")]
pub comment_id: Option<Uuid>,
// project 模块暂时移除后保留列,恢复时加回 belongs_to(同 comment/issue_event_line/issue_pin/issue_watch)
pub project_id: Option<Uuid>,
#[sea_orm(unique_key = "issue_user_emoji")]
#[sea_orm(unique_key = "comment_user_emoji")]
pub user_id: i64,
#[sea_orm(unique_key = "issue_user_emoji")]
#[sea_orm(unique_key = "comment_user_emoji")]
pub emoji: String,
pub created_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "issue_id", to = "id")]
pub issue: BelongsTo<Option<super::issue_item::Entity>>,
#[sea_orm(belongs_to, from = "comment_id", to = "id")]
pub comment: BelongsTo<Option<super::comment::Entity>>,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<super::super::users::user::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}