risingwave_meta_model_migration/
m20240617_070131_index_column_properties.rs1use sea_orm_migration::prelude::*;
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 Table::alter()
14 .table(Index::Table)
15 .add_column(ColumnDef::new(Index::IndexColumnProperties).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 Table::alter()
25 .table(Index::Table)
26 .drop_column(Index::IndexColumnProperties)
27 .to_owned(),
28 )
29 .await
30 }
31}
32
33#[derive(DeriveIden)]
34enum Index {
35 Table,
36 IndexColumnProperties,
37}