risingwave_meta_model/
worker_property.rsuse sea_orm::entity::prelude::*;
use serde::{Deserialize, Serialize};
use crate::WorkerId;
#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
#[sea_orm(table_name = "worker_property")]
pub struct Model {
#[sea_orm(primary_key, auto_increment = false)]
pub worker_id: WorkerId,
pub parallelism: i32,
pub is_streaming: bool,
pub is_serving: bool,
pub is_unschedulable: bool,
pub internal_rpc_host_addr: Option<String>,
}
#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
pub enum Relation {
#[sea_orm(
belongs_to = "super::worker::Entity",
from = "Column::WorkerId",
to = "super::worker::Column::WorkerId",
on_update = "NoAction",
on_delete = "Cascade"
)]
Worker,
}
impl Related<super::worker::Entity> for Entity {
fn to() -> RelationDef {
Relation::Worker.def()
}
}
impl ActiveModelBehavior for ActiveModel {}