24 lines
669 B
Rust
24 lines
669 B
Rust
use sea_orm::entity::prelude::*;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Serialize, Deserialize)]
|
|
#[sea_orm(table_name = "scheduler_state")]
|
|
pub struct Model {
|
|
#[sea_orm(primary_key)]
|
|
pub id: i32,
|
|
#[sea_orm(unique)]
|
|
pub job_name: String,
|
|
#[sea_orm(nullable)]
|
|
pub last_run_at: Option<chrono::NaiveDateTime>,
|
|
#[sea_orm(nullable)]
|
|
pub last_result: Option<String>,
|
|
#[sea_orm(nullable)]
|
|
pub next_run_at: Option<chrono::NaiveDateTime>,
|
|
pub enabled: bool,
|
|
}
|
|
|
|
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
|
|
pub enum Relation {}
|
|
|
|
impl ActiveModelBehavior for ActiveModel {}
|