risingwave_meta_model_migration/
m20251208_134652_clean_watermark_indices.rs

1use sea_orm_migration::prelude::{Table as MigrationTable, *};
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                MigrationTable::alter()
12                    .table(Table::Table)
13                    .add_column(ColumnDef::new(Table::CleanWatermarkIndices).json())
14                    .to_owned(),
15            )
16            .await
17    }
18
19    async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
20        manager
21            .alter_table(
22                MigrationTable::alter()
23                    .table(Table::Table)
24                    .drop_column(Table::CleanWatermarkIndices)
25                    .to_owned(),
26            )
27            .await
28    }
29}
30
31#[derive(DeriveIden)]
32enum Table {
33    Table,
34    CleanWatermarkIndices,
35}