Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(hardfork): bump db migrate version for the new column family of block extension data #2878

Merged
merged 1 commit into from
Aug 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions util/launcher/src/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ impl Migrate {
migrations.add_migration(Box::new(migrations::CellMigration));
migrations.add_migration(Box::new(migrations::AddNumberHashMapping));
migrations.add_migration(Box::new(migrations::AddExtraDataHash));
migrations.add_migration(Box::new(migrations::AddBlockExtensionColumnFamily));

Migrate {
migrations,
Expand Down
25 changes: 25 additions & 0 deletions util/launcher/src/migrations/add_block_extension_cf.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
use ckb_db::{Result, RocksDB};
use ckb_db_migration::{Migration, ProgressBar};
use std::sync::Arc;

pub struct AddBlockExtensionColumnFamily;

const VERSION: &str = "20210727100000";

impl Migration for AddBlockExtensionColumnFamily {
fn migrate(
&self,
db: RocksDB,
_pb: Arc<dyn Fn(u64) -> ProgressBar + Send + Sync>,
) -> Result<RocksDB> {
Ok(db)
}

fn version(&self) -> &str {
VERSION
}

fn expensive(&self) -> bool {
false
}
}
2 changes: 2 additions & 0 deletions util/launcher/src/migrations/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
mod add_block_extension_cf;
mod add_extra_data_hash;
mod add_number_hash_mapping;
mod cell;
mod table_to_struct;

pub use add_block_extension_cf::AddBlockExtensionColumnFamily;
pub use add_extra_data_hash::AddExtraDataHash;
pub use add_number_hash_mapping::AddNumberHashMapping;
pub use cell::CellMigration;
Expand Down