use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "image")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(unique)]
pub reference: String,
pub size_bytes: Option<i64>,
pub last_used_at: Option<DateTime>,
pub created_at: Option<DateTime>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::index::Entity")]
Index,
#[sea_orm(has_many = "super::manifest::Entity")]
Manifest,
}
impl Related<super::index::Entity> for Entity {
fn to() -> RelationDef {
Relation::Index.def()
}
}
impl Related<super::manifest::Entity> for Entity {
fn to() -> RelationDef {
Relation::Manifest.def()
}
}
impl ActiveModelBehavior for ActiveModel {}