use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "cpu_allocation")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
pub run_id: i32,
pub requested_policy: String,
pub resolved_policy: String,
pub enforcement: String,
pub topology_fingerprint: String,
pub lease_name: String,
pub state: String,
pub created_at: DateTime,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::run::Entity",
from = "Column::RunId",
to = "super::run::Column::Id",
on_delete = "Cascade"
)]
Run,
}
impl Related<super::run::Entity> for Entity {
fn to() -> RelationDef {
Relation::Run.def()
}
}
impl ActiveModelBehavior for ActiveModel {}