Skip to content

Commit

Permalink
Update m20240630_131430 migration: Parallelism to int, redo `Parall…
Browse files Browse the repository at this point in the history
…elUnitIds` as json_binary
  • Loading branch information
shanicky committed Jun 30, 2024
1 parent 4658e74 commit 53fd0dc
Showing 1 changed file with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,16 @@ impl MigrationTrait for Migration {
.alter_table(
Table::alter()
.table(WorkerProperty::Table)
.add_column(ColumnDef::new(WorkerProperty::Parallelism).binary())
.add_column(ColumnDef::new(WorkerProperty::Parallelism).integer())
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(WorkerProperty::Table)
.drop_column(WorkerProperty::ParallelUnitIds)
.to_owned(),
)
.await
Expand All @@ -24,6 +33,19 @@ impl MigrationTrait for Migration {
.drop_column(WorkerProperty::Parallelism)
.to_owned(),
)
.await?;

manager
.alter_table(
Table::alter()
.table(WorkerProperty::Table)
.add_column(
ColumnDef::new(WorkerProperty::ParallelUnitIds)
.json_binary()
.not_null(),
)
.to_owned(),
)
.await
}
}
Expand All @@ -32,4 +54,5 @@ impl MigrationTrait for Migration {
enum WorkerProperty {
Table,
Parallelism,
ParallelUnitIds,
}

0 comments on commit 53fd0dc

Please sign in to comment.