Implement database downgrade

This commit is contained in:
Michael Sproul
2022-03-14 17:52:18 +11:00
parent b4c60807dd
commit 1a261e1d3b
3 changed files with 70 additions and 3 deletions

View File

@@ -188,8 +188,7 @@ pub fn migrate_schema<T: BeaconChainTypes>(
(SchemaVersion(9), SchemaVersion(10)) => migration_schema_v10::upgrade_to_v10::<T>(db, log),
// Downgrade for tree-states database changes.
(SchemaVersion(10), SchemaVersion(8)) => {
// FIXME(sproul): implement downgrade
panic!("downgrade not implemented yet")
migration_schema_v10::downgrade_from_v10::<T>(db, log)
}
// Anything else is an error.
(_, _) => Err(HotColdDBError::UnsupportedSchemaVersion {