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, pub created_at: OffsetDateTime, #[sea_orm(belongs_to, from = "repo_id", to = "id")] pub repo: BelongsTo, #[sea_orm(belongs_to, from = "(repo_id, oid)", to = "(repo_id, oid)")] pub lfs: BelongsTo>, #[sea_orm(belongs_to, from = "owner_id", to = "uid")] pub owner: BelongsTo, } impl ActiveModelBehavior for ActiveModel {}