use crate::{DateTimeUtc, RepoId, UserId};
use sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
#[sea_orm(table_name = "repo_lfs_object")]
pub struct Model {
    #[sea_orm(primary_key)]
    pub id: i64,
    pub oid: String,
    #[sea_orm(column_name = "repo_uuid")]
    pub repo: RepoId,
    pub size: i64,
    pub storage_path: String,
    #[sea_orm(column_name = "uploaded_by")]
    pub uploaded_by: Option<UserId>,
    pub uploaded_at: DateTimeUtc,
}

#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {}

impl ActiveModelBehavior for ActiveModel {}
