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

Better handling of multiple migrations #1747

Merged
merged 5 commits into from
Jul 28, 2016
Merged

Better handling of multiple migrations #1747

merged 5 commits into from
Jul 28, 2016

Conversation

keorn
Copy link

@keorn keorn commented Jul 27, 2016

Closes #1745

@keorn keorn added the A0-pleasereview 🤓 Pull request needs code review. label Jul 27, 2016
@keorn keorn mentioned this pull request Jul 27, 2016
@coveralls
Copy link

coveralls commented Jul 27, 2016

Coverage Status

Coverage decreased (-0.1%) to 86.768% when pulling 3d38e05 on noop-migrations into 6b1e722 on master.

@arkpar arkpar added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jul 27, 2016
/// Find all needed migrations and arrange them.
fn migrations_from(&mut self, version: u32) -> Vec<&mut Box<Migration>> {
let mut to_apply: Vec<_> = self.migrations.iter_mut().filter(|m| m.version() > version).collect();
to_apply.sort_by_key(|m| m.version());
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this needed? We already have a check in add_migration, no?

@tomusdrw
Copy link
Collaborator

There is also order assumption here: https://github.com/ethcore/parity/blob/3d38e05879f52176e78feeade1ee0ec37c9cb11d/util/src/migration/mod.rs#L233
Probably should be addressed.

@tomusdrw tomusdrw added A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. and removed A8-looksgood 🦄 Pull request is reviewed well. labels Jul 28, 2016
@keorn keorn added A0-pleasereview 🤓 Pull request needs code review. and removed A5-grumble 🔥 Pull request has minor issues that must be addressed before merging. labels Jul 28, 2016
@tomusdrw tomusdrw added A8-looksgood 🦄 Pull request is reviewed well. and removed A0-pleasereview 🤓 Pull request needs code review. labels Jul 28, 2016
@@ -209,7 +209,7 @@ impl Manager {
// start with the old db.
let old_path_str = try!(old_path.to_str().ok_or(Error::MigrationImpossible));
let mut cur_db = try!(Database::open(&db_config, old_path_str).map_err(Error::Custom));
for migration in migrations {
for migration in migrations.iter_mut() {
Copy link
Collaborator

@tomusdrw tomusdrw Jul 28, 2016

Choose a reason for hiding this comment

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

@coveralls
Copy link

coveralls commented Jul 28, 2016

Coverage Status

Coverage decreased (-0.1%) to 86.763% when pulling 8a676cb on noop-migrations into 6b1e722 on master.

@coveralls
Copy link

coveralls commented Jul 28, 2016

Coverage Status

Coverage decreased (-0.1%) to 86.759% when pulling 3d4ac2c on noop-migrations into 6b1e722 on master.

@gavofyork gavofyork merged commit 30ba10e into master Jul 28, 2016
@gavofyork gavofyork deleted the noop-migrations branch July 28, 2016 10:05
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants