Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
zwang28 committed Sep 9, 2024
1 parent 28f9770 commit 9978e76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ impl MigrationTrait for Migration {
.get_connection()
.execute(sea_orm::Statement::from_string(
sea_orm::DatabaseBackend::MySql,
format!(
"ALTER TABLE {TABLE_NAME}
DROP PRIMARY KEY,
ADD PRIMARY KEY (epoch, table_id)"
),
format!("ALTER TABLE {TABLE_NAME} DROP PRIMARY KEY, ADD PRIMARY KEY (epoch, table_id)"),
))
.await?;
}
Expand Down Expand Up @@ -148,9 +144,7 @@ impl MigrationTrait for Migration {
.get_connection()
.execute(sea_orm::Statement::from_string(
sea_orm::DatabaseBackend::Postgres,
format!(
"ALTER TABLE {TABLE_NAME} ADD PRIMARY KEY (epoch)"
),
format!("ALTER TABLE {TABLE_NAME} ADD PRIMARY KEY (epoch)"),
))
.await?;
}
Expand Down
7 changes: 2 additions & 5 deletions src/meta/src/hummock/manager/time_travel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -286,10 +286,7 @@ impl HummockManager {
let epoch_to_version = hummock_epoch_to_version::Entity::find()
.filter(
Condition::any()
.add(
hummock_epoch_to_version::Column::TableId
.eq(i64::try_from(table_id).unwrap()),
)
.add(hummock_epoch_to_version::Column::TableId.eq(i64::from(table_id)))
// for backward compatibility
.add(hummock_epoch_to_version::Column::TableId.eq(0)),
)
Expand Down Expand Up @@ -422,7 +419,7 @@ impl HummockManager {
let version_id: u64 = delta.id.to_u64();
let m = hummock_epoch_to_version::ActiveModel {
epoch: Set(committed_epoch.try_into().unwrap()),
table_id: Set(table_id.table_id.try_into().unwrap()),
table_id: Set(table_id.table_id.into()),
version_id: Set(version_id.try_into().unwrap()),
};
// There should be no conflict rows.
Expand Down

0 comments on commit 9978e76

Please sign in to comment.