risingwave_meta_model_migration/
m20241001_013810_webhook_source.rs

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