mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-25 11:27:31 -07:00
Fix account domain migration
This commit is contained in:
parent
aa76cf1c33
commit
537d63a11e
2 changed files with 39 additions and 0 deletions
|
@ -5,6 +5,7 @@ mod m20230627_185451_index_note_url;
|
||||||
mod m20230709_000510_move_antenna_to_cache;
|
mod m20230709_000510_move_antenna_to_cache;
|
||||||
mod m20230726_213530_drop_ads;
|
mod m20230726_213530_drop_ads;
|
||||||
mod m20230801_160334_add_instance_account_domain;
|
mod m20230801_160334_add_instance_account_domain;
|
||||||
|
mod m20230802_190415_fix_instance_account_domain;
|
||||||
|
|
||||||
pub struct Migrator;
|
pub struct Migrator;
|
||||||
|
|
||||||
|
@ -17,6 +18,7 @@ impl MigratorTrait for Migrator {
|
||||||
Box::new(m20230709_000510_move_antenna_to_cache::Migration),
|
Box::new(m20230709_000510_move_antenna_to_cache::Migration),
|
||||||
Box::new(m20230726_213530_drop_ads::Migration),
|
Box::new(m20230726_213530_drop_ads::Migration),
|
||||||
Box::new(m20230801_160334_add_instance_account_domain::Migration),
|
Box::new(m20230801_160334_add_instance_account_domain::Migration),
|
||||||
|
Box::new(m20230802_190415_fix_instance_account_domain::Migration),
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
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
|
||||||
|
.alter_table(
|
||||||
|
Table::alter()
|
||||||
|
.table(Instance::Table)
|
||||||
|
.rename_column(Alias::new("account_domain"), Instance::AccountDomain)
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||||
|
manager
|
||||||
|
.alter_table(
|
||||||
|
Table::alter()
|
||||||
|
.table(Instance::Table)
|
||||||
|
.rename_column(Instance::AccountDomain, Alias::new("account_domain"))
|
||||||
|
.to_owned(),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Learn more at https://docs.rs/sea-query#iden
|
||||||
|
#[derive(Iden)]
|
||||||
|
enum Instance {
|
||||||
|
Table,
|
||||||
|
#[iden = "accountDomain"]
|
||||||
|
AccountDomain,
|
||||||
|
}
|
Loading…
Reference in a new issue