Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
fmt
  • Loading branch information
xxhZs committed Apr 17, 2024
1 parent 4ae2c2b commit f5a0228
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/meta/model_v2/migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ mod m20231008_020431_hummock;
mod m20240304_074901_subscription;
mod m20240410_082733_with_version_column_migration;
mod m20240410_154406_session_params;
mod m20240417_062305_subscription_internal_table_name;

pub struct Migrator;

Expand All @@ -19,6 +20,7 @@ impl MigratorTrait for Migrator {
Box::new(m20240304_074901_subscription::Migration),
Box::new(m20240410_082733_with_version_column_migration::Migration),
Box::new(m20240410_154406_session_params::Migration),
Box::new(m20240417_062305_subscription_internal_table_name::Migration),
]
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
use sea_orm_migration::prelude::{Table as MigrationTable, *};
#[derive(DeriveMigrationName)]
pub struct Migration;

#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
MigrationTable::alter()
.table(Subscription::Table)
.add_column(
ColumnDef::new(Subscription::SubscriptionInternalTableName).integer(),
)
.to_owned(),
)
.await?;

Ok(())
}

async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
MigrationTable::alter()
.table(Subscription::Table)
.drop_column(Alias::new(
Subscription::SubscriptionInternalTableName.to_string(),
))
.to_owned(),
)
.await?;
Ok(())
}
}

#[derive(DeriveIden)]
enum Subscription {
Table,
SubscriptionInternalTableName,
}

0 comments on commit f5a0228

Please sign in to comment.