From fdaa30f0d670c6f04f4e6be5d193f9146d179d95 Mon Sep 17 00:00:00 2001 From: Olivia Lee Date: Sun, 1 Dec 2024 17:09:58 -0800 Subject: [PATCH] silly hack to allow migrating from conduit 0.9.0 to grapevine Starting once with this patch will roll the db version back to 13, and then grapevine can be run without the patch from that point onward. The real way we want to do this is to finish the db compatibility break work in !85, but this can serve as a stopgap. --- src/database.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/database.rs b/src/database.rs index 5205b9ca..5b2e8a5c 100644 --- a/src/database.rs +++ b/src/database.rs @@ -997,6 +997,14 @@ impl KeyValueDatabase { Ok(()) })?; + // Hack to ignore conduit's 13->16 migration. This is fine because + // the migration is idempotent, so it will just be run a second time + // as a no-op when switching from grapevine to conduit. + if services().globals.database_version().unwrap() == 16 { + services().globals.bump_database_version(13)?; + warn!("Reverted: 16 -> 13"); + } + assert_eq!( services().globals.database_version().unwrap(), latest_database_version,