removed old migrations#7974
Conversation
| /// 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>)>; |
There was a problem hiding this comment.
This is the only new thing in this pr. I added it, cause it's good to know what column we are migrating
|
Does not compile |
| /// Version of database after the migration. | ||
| fn version(&self) -> u32; | ||
| /// Index of column which should be migrated. | ||
| fn migrated_column_index(&self) -> Option<u32>; |
There was a problem hiding this comment.
without this function, the trait is completely useless, cause we don't know which column we are currently migrating
|
I think that migrations should be completely reworked. This pr makes a minimal effort take the most out of what we currently have. |
|
shoud be backported together with #7934 |
| batch.insert(key, value, dest)?; | ||
| } | ||
| } else { | ||
| batch.insert(key.into_vec(), value.into_vec(), dest)?; |
There was a problem hiding this comment.
By default we are just altering the database, do we really need to overwrite the data?
There was a problem hiding this comment.
Unfortunately, we are not altering, but swapping :(
There was a problem hiding this comment.
yes, since it can fail we need to keep a backup until it completes
Uh oh!
There was an error while loading. Please reload this page.