Skip to content
Clone
a06673b
27 lines 996 B Rust
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,
pub issue_id: Option<Uuid>,
pub comment_id: Option<Uuid>,
pub project_id: Option<Uuid>,
pub user_id: Uuid,
pub emoji: String,
pub created_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "issue_id", to = "id")]
pub issue: BelongsTo<Option<super::issue::Entity>>,
#[sea_orm(belongs_to, from = "comment_id", to = "id")]
pub comment: BelongsTo<Option<super::comment::Entity>>,
#[sea_orm(belongs_to, from = "project_id", to = "id")]
pub project: BelongsTo<Option<super::super::project::project::Entity>>,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}