risingwave_meta_model/
streaming_job.rsuse sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use crate::{CreateType, JobStatus, StreamingParallelism};
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "streaming_job")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub job_id: i32,
pub job_status: JobStatus,
pub create_type: CreateType,
pub timezone: Option<String>,
pub parallelism: StreamingParallelism,
pub max_parallelism: i32,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::object::Entity",
from = "Column::JobId",
to = "super::object::Column::Oid",
on_update = "NoAction",
on_delete = "Cascade"
)]
Object,
}
impl Related<super::object::Entity> for Entity {
fn to() -> RelationDef {
Relation::Object.def()
}
}
impl ActiveModelBehavior for ActiveModel {}