use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel)]
#[sea_orm(table_name = "config")]
pub struct Model {
#[sea_orm(primary_key)]
pub id: i32,
#[sea_orm(unique)]
pub manifest_id: i32,
pub digest: String,
pub env: Option<String>,
pub cmd: Option<String>,
pub entrypoint: Option<String>,
pub working_dir: Option<String>,
pub user: Option<String>,
pub labels: Option<String>,
pub stop_signal: Option<String>,
pub created_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 {}