risingwave_meta_model/
worker_property.rs1use sea_orm::entity::prelude::*;
16use serde::{Deserialize, Serialize};
17
18use crate::WorkerId;
19
20#[derive(Clone, Debug, PartialEq, DeriveEntityModel, Eq, Serialize, Deserialize)]
21#[sea_orm(table_name = "worker_property")]
22pub struct Model {
23 #[sea_orm(primary_key, auto_increment = false)]
24 pub worker_id: WorkerId,
25 pub parallelism: i32,
26 pub is_streaming: bool,
27 pub is_serving: bool,
28 pub is_unschedulable: bool,
29 pub internal_rpc_host_addr: Option<String>,
30 pub resource_group: Option<String>,
31 pub is_iceberg_compactor: bool,
32}
33
34#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
35pub enum Relation {
36 #[sea_orm(
37 belongs_to = "super::worker::Entity",
38 from = "Column::WorkerId",
39 to = "super::worker::Column::WorkerId",
40 on_update = "NoAction",
41 on_delete = "Cascade"
42 )]
43 Worker,
44}
45
46impl Related<super::worker::Entity> for Entity {
47 fn to() -> RelationDef {
48 Relation::Worker.def()
49 }
50}
51
52impl ActiveModelBehavior for ActiveModel {}