From cfbb11916a29dbc35f7674bf1fcb38ae14046992 Mon Sep 17 00:00:00 2001 From: Benjamin Lee Date: Sat, 31 Aug 2024 14:58:38 -0700 Subject: [PATCH] no-op migration to break db compatibility This ensures that the compatibility break works as expected without any other changes to the schema to muck things up. --- src/database.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/database.rs b/src/database.rs index da87079c..f0d314c8 100644 --- a/src/database.rs +++ b/src/database.rs @@ -535,7 +535,7 @@ impl KeyValueDatabase { #[allow(clippy::too_many_lines)] pub(crate) async fn apply_migrations(&self) -> Result<()> { // If the database has any data, perform data migrations before starting - let latest_database_version = DbVersion::Conduit(13); + let latest_database_version = DbVersion::Grapevine(0); let current_database_version = services().globals.database_version()?; if !current_database_version.is_compatible() { @@ -1081,6 +1081,10 @@ impl KeyValueDatabase { Ok(()) })?; + // Switch to the grapevine version namespace and break db + // compatibility with conduit. Otherwise a no-op. + migration(DbVersion::Grapevine(0), || Ok(()))?; + assert_eq!( services().globals.database_version().unwrap(), latest_database_version,