Skip to content
Clone
41414ba
zhenyi docs: add cybersecurity notes
37 lines 1.1 KB Rust
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
use uuid::Uuid;
#[derive(
Debug, Clone, Copy, PartialEq, Eq, Default, EnumIter, DeriveActiveEnum, Serialize, Deserialize,
)]
#[sea_orm(rs_type = "i32", db_type = "SmallInteger")]
pub enum ReviewState {
#[default]
Approved = 0,
ChangesRequested = 1,
Commented = 2,
}
#[sea_orm::model]
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "pull_request_review")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
pub pull_request_id: Uuid,
pub user_id: Uuid,
pub commit_sha: String,
pub official: bool,
pub content: Option<String>,
pub state: ReviewState,
pub created_at: OffsetDateTime,
pub updated_at: Option<OffsetDateTime>,
#[sea_orm(belongs_to, from = "pull_request_id", to = "id")]
pub pull_request: BelongsTo<super::pull_requests::Entity>,
#[sea_orm(belongs_to, from = "user_id", to = "uid")]
pub user: BelongsTo<super::super::user::users::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}