2ae9196
ZhenYi
feat(lib/git): add HTTP handler tree with routes and errors across analysis, archives, blobs, branches, commits, conflicts, content, diffs, hooks, lfs, logs, maintenance, packs, patches, pipelines, refs, remotes, repos, signatures, submodules, tags, trees
2ae9196
use sea_orm::entity::prelude::*;
use time::OffsetDateTime;
use uuid::Uuid;
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "pull_request")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(unique_key = "repo_number")]
pub repo_id: Uuid,
pub issue_id: Uuid,
#[sea_orm(unique_key = "repo_number")]
pub autoincrement_id: i32,
pub author_id: Uuid,
pub title: String,
pub body: String,
pub head_branch: String,
pub head_sha: String,
pub base_branch: String,
pub base_sha: String,
pub has_merged: bool,
pub merged_commit_sha: Option<String>,
pub additions: i32,
pub deletions: i32,
pub files_changed: i32,
pub merger_id: Option<Uuid>,
pub merged_at: Option<OffsetDateTime>,
pub is_locked: bool,
pub created_at: OffsetDateTime,
pub updated_at: Option<OffsetDateTime>,
pub closed_at: Option<OffsetDateTime>,
#[sea_orm(belongs_to, from = "repo_id", to = "id")]
pub repo: BelongsTo<super::super::repo::repos::Entity>,
#[sea_orm(belongs_to, from = "issue_id", to = "id")]
pub issue: BelongsTo<super::super::issue::issue_item::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, relation_enum = "Merger", from = "merger_id", to = "uid")]
pub merger: BelongsTo<Option<super::super::users::user::Entity>>,
}
impl ActiveModelBehavior for ActiveModel {}