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.
This commit is contained in:
Benjamin Lee 2024-08-31 14:58:38 -07:00
parent 82a75dc2c1
commit cfbb11916a
No known key found for this signature in database
GPG key ID: FB9624E2885D55A4

View file

@ -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,