Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

removed old migrations #7974

Merged
merged 7 commits into from
Feb 22, 2018
Merged

removed old migrations #7974

merged 7 commits into from
Feb 22, 2018

Conversation

debris
Copy link
Collaborator

@debris debris commented Feb 22, 2018

  • removed all migrations from 2016
  • added migration to remove bloom group from database

@debris debris added A0-pleasereview 🤓 Pull request needs code review. M4-core ⛓ Core client code / Rust. labels Feb 22, 2018
@@ -138,7 +138,7 @@ pub trait SimpleMigration: 'static {
fn version(&self) -> u32;
/// Should migrate existing object to new database.
/// Returns `None` if the object does not exist in new version of database.
fn simple_migrate(&mut self, key: Vec<u8>, value: Vec<u8>) -> Option<(Vec<u8>, Vec<u8>)>;
fn simple_migrate(&mut self, key: Vec<u8>, value: Vec<u8>, col: Option<u32>) -> Option<(Vec<u8>, Vec<u8>)>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only new thing in this pr. I added it, cause it's good to know what column we are migrating

@5chdn 5chdn added this to the 1.10 milestone Feb 22, 2018
@5chdn
Copy link
Contributor

5chdn commented Feb 22, 2018

Does not compile

pub trait SimpleMigration: 'static {
/// Number of columns in database after the migration.
fn columns(&self) -> Option<u32>;
/// Version of database after the migration.
fn version(&self) -> u32;
/// Index of column which should be migrated.
fn migrated_column_index(&self) -> Option<u32>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

without this function, the trait is completely useless, cause we don't know which column we are currently migrating

@debris
Copy link
Collaborator Author

debris commented Feb 22, 2018

I think that migrations should be completely reworked. This pr makes a minimal effort take the most out of what we currently have.

@debris debris added B0-patch B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. labels Feb 22, 2018
@debris
Copy link
Collaborator Author

debris commented Feb 22, 2018

shoud be backported together with #7934

batch.insert(key, value, dest)?;
}
} else {
batch.insert(key.into_vec(), value.into_vec(), dest)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default we are just altering the database, do we really need to overwrite the data?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, since it can fail we need to keep a backup until it completes

@debris debris added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Feb 22, 2018
@debris debris merged commit ee93be8 into master Feb 22, 2018
@debris debris deleted the removed_old_migrations branch February 22, 2018 13:53
@tomusdrw tomusdrw mentioned this pull request Feb 27, 2018
10 tasks
@5chdn 5chdn removed the B0-patch label Feb 27, 2018
@debris debris mentioned this pull request Mar 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A8-looksgood 🦄 Pull request is reviewed well. B7-releasenotes 📜 Changes should be mentioned in the release notes of the next minor version release. M4-core ⛓ Core client code / Rust.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants