Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mod m20180905_090102_populate_activities;
mod m20180921_110336_add_admins;
mod m20180922_104727_add_superadmins;
mod m20250828_224244_add_destiny_rising_uids;
mod m20250910_152923_rename_tables;
mod tables;

pub use tables::*;
Expand All @@ -31,6 +32,7 @@ impl MigratorTrait for Migrator {
Box::new(m20180921_110336_add_admins::Migration),
Box::new(m20180922_104727_add_superadmins::Migration),
Box::new(m20250828_224244_add_destiny_rising_uids::Migration),
Box::new(m20250910_152923_rename_tables::Migration),
]
}
}
77 changes: 77 additions & 0 deletions migration/src/m20250910_152923_rename_tables.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
use sea_orm_migration::prelude::*;

#[derive(DeriveMigrationName)]
pub struct Migration;

#[async_trait::async_trait]
impl MigrationTrait for Migration {
async fn up(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.rename_table(
Table::rename()
.table(
Alias::new("activityshortcuts"),
Alias::new("activity_shortcuts"),
)
.to_owned(),
)
.await?;

manager
.rename_table(
Table::rename()
.table(
Alias::new("plannedactivities"),
Alias::new("planned_activities"),
)
.to_owned(),
)
.await?;

manager
.rename_table(
Table::rename()
.table(
Alias::new("plannedactivitymembers"),
Alias::new("planned_activity_members"),
)
.to_owned(),
)
.await
}

async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.rename_table(
Table::rename()
.table(
Alias::new("activity_shortcuts"),
Alias::new("activityshortcuts"),
)
.to_owned(),
)
.await?;

manager
.rename_table(
Table::rename()
.table(
Alias::new("planned_activities"),
Alias::new("plannedactivities"),
)
.to_owned(),
)
.await?;

manager
.rename_table(
Table::rename()
.table(
Alias::new("planned_activity_members"),
Alias::new("plannedactivitymembers"),
)
.to_owned(),
)
.await
}
}