Skip to content
Clone
acbf7ea
28 lines 941 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 = "git_commit")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub repo_id: Uuid,
#[sea_orm(primary_key, auto_increment = false)]
pub sha: String,
pub message: String,
pub author_id: Option<i64>,
pub author_name: String,
pub author_email: String,
pub authored_at: OffsetDateTime,
pub committer_name: String,
pub committer_email: String,
pub committed_at: OffsetDateTime,
pub created_at: OffsetDateTime,
#[sea_orm(belongs_to, from = "repo_id", to = "id")]
pub repo: BelongsTo<super::super::repo::repos::Entity>,
#[sea_orm(belongs_to, from = "author_id", to = "uid")]
pub author: BelongsTo<Option<super::super::users::user::Entity>>,
}
impl ActiveModelBehavior for ActiveModel {}