Skip to content

Commit

Permalink
make task max batch size a big integer (#91)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbr committed May 12, 2023
1 parent 03fea38 commit 14280ed
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
2 changes: 2 additions & 0 deletions migration/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod m20230211_224853_create_sessions;
mod m20230211_233835_create_accounts;
mod m20230217_211422_create_memberships;
mod m20230322_223043_add_fields_to_task;
mod m20230512_200213_make_task_max_batch_size_a_big_integer;

pub struct Migrator;

Expand All @@ -17,6 +18,7 @@ impl MigratorTrait for Migrator {
Box::new(m20230211_233835_create_accounts::Migration),
Box::new(m20230217_211422_create_memberships::Migration),
Box::new(m20230322_223043_add_fields_to_task::Migration),
Box::new(m20230512_200213_make_task_max_batch_size_a_big_integer::Migration),
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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(Task::Table)
.modify_column(ColumnDef::new(Task::MaxBatchSize).big_integer().null())
.to_owned(),
)
.await
}

async fn down(&self, manager: &SchemaManager) -> Result<(), DbErr> {
manager
.alter_table(
Table::alter()
.table(Task::Table)
.modify_column(ColumnDef::new(Task::MaxBatchSize).integer().null())
.to_owned(),
)
.await
}
}

#[derive(Iden)]
enum Task {
Table,
MaxBatchSize,
}

0 comments on commit 14280ed

Please sign in to comment.