Skip to content

Commit

Permalink
fix(migration/user_feed): fix alter table (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwaa authored Sep 14, 2024
1 parent 8e039b1 commit 0034188
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions crates/db_migration/src/m20240515_000002_user_feed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,32 @@ impl MigrationTrait for Migration {
Table::alter()
.table(User::Table)
.add_column(json_null(User::Feed))
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(User::Table)
.drop_column(User::FeedJson)
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(User::Table)
.drop_column(User::FeedAtom)
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(User::Table)
.drop_column(User::FeedRss)
.to_owned(),
)
Expand All @@ -29,8 +53,32 @@ impl MigrationTrait for Migration {
Table::alter()
.table(User::Table)
.drop_column(User::Feed)
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(User::Table)
.add_column(string_null(User::FeedJson))
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(User::Table)
.add_column(string_null(User::FeedAtom))
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(User::Table)
.add_column(string_null(User::FeedRss))
.to_owned(),
)
Expand Down

0 comments on commit 0034188

Please sign in to comment.