use sea_orm::entity::prelude::*;
#[derive(Clone, Debug, PartialEq, Eq, DeriveEntityModel)]
#[sea_orm(table_name = "asynq_schedulers")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub id: String,
pub host: String,
pub pid: i32,
pub status: String,
pub started_at: DateTimeWithTimeZone,
pub expires_at: DateTimeWithTimeZone,
#[sea_orm(column_type = "VarBinary(StringLen::None)", nullable)]
pub scheduler_info: Option<Vec<u8>>,
pub tenant_id: Option<String>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(has_many = "super::scheduler_entries::Entity")]
SchedulerEntries,
}
impl Related<super::scheduler_entries::Entity> for Entity {
fn to() -> RelationDef {
Relation::SchedulerEntries.def()
}
}
impl ActiveModelBehavior for ActiveModel {}