Add identity_hash column
Build and Publish Docker Container / build (push) Failing after 9m27s

This commit is contained in:
2024-05-29 21:08:51 +01:00
parent f19f861297
commit 3df05b2d9c
5 changed files with 57 additions and 2 deletions
+5 -1
View File
@@ -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,
}