mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-19 08:41:24 +01:00
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:
parent
82a75dc2c1
commit
cfbb11916a
1 changed files with 5 additions and 1 deletions
|
|
@ -535,7 +535,7 @@ impl KeyValueDatabase {
|
||||||
#[allow(clippy::too_many_lines)]
|
#[allow(clippy::too_many_lines)]
|
||||||
pub(crate) async fn apply_migrations(&self) -> Result<()> {
|
pub(crate) async fn apply_migrations(&self) -> Result<()> {
|
||||||
// If the database has any data, perform data migrations before starting
|
// 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()?;
|
let current_database_version = services().globals.database_version()?;
|
||||||
if !current_database_version.is_compatible() {
|
if !current_database_version.is_compatible() {
|
||||||
|
|
@ -1081,6 +1081,10 @@ impl KeyValueDatabase {
|
||||||
Ok(())
|
Ok(())
|
||||||
})?;
|
})?;
|
||||||
|
|
||||||
|
// Switch to the grapevine version namespace and break db
|
||||||
|
// compatibility with conduit. Otherwise a no-op.
|
||||||
|
migration(DbVersion::Grapevine(0), || Ok(()))?;
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
services().globals.database_version().unwrap(),
|
services().globals.database_version().unwrap(),
|
||||||
latest_database_version,
|
latest_database_version,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue