risingwave_meta_model/
worker_property.rs1use sea_orm::entity::prelude::*;
16use serde::{Deserialize, Serialize};
17
18use crate::{WorkerId, WorkerResource};
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 pub resource: Option<WorkerResource>,
33 pub started_at: Option<i64>,
34}
35
36#[derive(Copy, Clone, Debug, EnumIter, DeriveRelation)]
37pub enum Relation {
38 #[sea_orm(
39 belongs_to = "super::worker::Entity",
40 from = "Column::WorkerId",
41 to = "super::worker::Column::WorkerId",
42 on_update = "NoAction",
43 on_delete = "Cascade"
44 )]
45 Worker,
46}
47
48impl Related<super::worker::Entity> for Entity {
49 fn to() -> RelationDef {
50 Relation::Worker.def()
51 }
52}
53
54impl ActiveModelBehavior for ActiveModel {}