Skip to content
Clone
194c44c
36 lines 1.3 KB 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 = "code_comment")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(indexed)]
pub repo_id: Uuid,
#[sea_orm(indexed)]
pub path: String,
pub line: i32,
#[sea_orm(indexed)]
pub commit_sha: String,
pub author_id: i64,
#[sea_orm(indexed)]
pub parent_id: Option<Uuid>,
pub body: String,
pub resolved_at: Option<OffsetDateTime>,
pub resolved_by: Option<i64>,
pub created_at: OffsetDateTime,
pub updated_at: Option<OffsetDateTime>,
#[sea_orm(belongs_to, from = "repo_id", to = "id")]
pub repo: BelongsTo<super::super::repo::repos::Entity>,
#[sea_orm(belongs_to, relation_enum = "Author", from = "author_id", to = "uid")]
pub author: BelongsTo<super::super::users::user::Entity>,
#[sea_orm(belongs_to, from = "resolved_by", to = "uid")]
pub resolver: BelongsTo<Option<super::super::users::user::Entity>>,
#[sea_orm(belongs_to, relation_enum = "Parent", from = "parent_id", to = "id")]
pub parent: BelongsTo<Option<super::code_comment::Entity>>,
}
impl ActiveModelBehavior for ActiveModel {}