use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "image_ref")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(unique)]
pub reference: String,
pub manifest_id: i32,
pub created_at: Option<DateTime>,
pub updated_at: Option<DateTime>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::manifest::Entity",
from = "Column::ManifestId",
to = "super::manifest::Column::Id",
on_delete = "Cascade"
)]
Manifest,
}
impl Related<super::manifest::Entity> for Entity {
fn to() -> RelationDef {
Relation::Manifest.def()
}
}
impl ActiveModelBehavior for ActiveModel {}