This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
pub use sea_orm_migration::prelude::*;
|
||||
|
||||
pub mod m20230904_141851_create_monzo_tables;
|
||||
mod m20240529_195030_add_transaction_identity_hash;
|
||||
|
||||
pub struct Migrator;
|
||||
|
||||
@@ -11,6 +12,9 @@ impl MigratorTrait for Migrator {
|
||||
}
|
||||
|
||||
fn migrations() -> Vec<Box<dyn MigrationTrait>> {
|
||||
vec![Box::new(m20230904_141851_create_monzo_tables::Migration)]
|
||||
vec![
|
||||
Box::new(m20230904_141851_create_monzo_tables::Migration),
|
||||
Box::new(m20240529_195030_add_transaction_identity_hash::Migration),
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
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(
|
||||
TableAlterStatement::new()
|
||||
.table(Transaction::Table)
|
||||
.add_column(
|
||||
ColumnDef::new(Transaction::IdentityHash)
|
||||
.big_integer()
|
||||
.unique_key(),
|
||||
).to_owned()
|
||||
).await
|
||||
}
|
||||
|
||||
async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
|
||||
manager.alter_table(
|
||||
TableAlterStatement::new()
|
||||
.table(Transaction::Table)
|
||||
.drop_column(Transaction::IdentityHash)
|
||||
.to_owned()
|
||||
).await
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(DeriveIden)]
|
||||
enum Transaction {
|
||||
Table,
|
||||
IdentityHash,
|
||||
}
|
||||
Reference in New Issue
Block a user