Move transaction whittling out of the database
Build and Publish Docker Container / build (push) Successful in 9m56s
Build and Publish Docker Container / build (push) Successful in 9m56s
This commit is contained in:
@@ -6,24 +6,29 @@ 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
|
||||
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
|
||||
manager
|
||||
.alter_table(
|
||||
TableAlterStatement::new()
|
||||
.table(Transaction::Table)
|
||||
.drop_column(Transaction::IdentityHash)
|
||||
.to_owned(),
|
||||
)
|
||||
.await
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user