risingwave_meta_model_migration/
m20241022_072553_node_label.rs1use sea_orm_migration::prelude::*;
2
3#[derive(DeriveMigrationName)]
4pub struct Migration;
5
6#[async_trait::async_trait]
7impl MigrationTrait for Migration {
8 async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
9 manager
10 .alter_table(
11 Table::alter()
12 .table(WorkerProperty::Table)
13 .add_column(ColumnDef::new(WorkerProperty::Label).string())
14 .to_owned(),
15 )
16 .await
17 }
18
19 async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
20 manager
21 .alter_table(
22 Table::alter()
23 .table(WorkerProperty::Table)
24 .drop_column(WorkerProperty::Label)
25 .to_owned(),
26 )
27 .await
28 }
29}
30
31#[derive(DeriveIden)]
32enum WorkerProperty {
33 Table,
34 Label,
35}