Skip to content
Clone
194c44c
26 lines 909 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_lfs_lock")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: Uuid,
#[sea_orm(unique_key = "repo_path")]
pub repo_id: Uuid,
#[sea_orm(unique_key = "repo_path")]
pub path: String,
pub owner_id: i64,
pub oid: Option<String>,
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 = "(repo_id, oid)", to = "(repo_id, oid)")]
pub lfs: BelongsTo<Option<super::git_lfs::Entity>>,
#[sea_orm(belongs_to, from = "owner_id", to = "uid")]
pub owner: BelongsTo<super::super::users::user::Entity>,
}
impl ActiveModelBehavior for ActiveModel {}