mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 08:11:24 +01:00
error migrating to/from conduit with conduit_compat disabled
In the future, we'll probably want to implement real support for changing the admin bot userid. For now, just error so things don't break in confusing ways. We should note in the docs when creating a new server, that if you don't enable conduit_compat you won't currently be able to migrate away.
This commit is contained in:
parent
3226d3a9eb
commit
8e966c7ac4
2 changed files with 17 additions and 0 deletions
|
|
@ -79,6 +79,15 @@ pub(crate) async fn run(
|
||||||
|
|
||||||
info!("Migrating from {current:?} to {target:?}");
|
info!("Migrating from {current:?} to {target:?}");
|
||||||
|
|
||||||
|
if !services().globals.config.conduit_compat {
|
||||||
|
if let DbMigrationTarget::Conduit(_) = args.to {
|
||||||
|
return Err(Error::ConduitCompatDisabled);
|
||||||
|
}
|
||||||
|
if let DbVersion::Conduit(_) = current {
|
||||||
|
return Err(Error::ConduitCompatDisabled);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if target == current {
|
if target == current {
|
||||||
// No-op
|
// No-op
|
||||||
} else if target == latest {
|
} else if target == latest {
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,14 @@ pub(crate) enum MigrateDbCommand {
|
||||||
#[error("output path is not valid unicode")]
|
#[error("output path is not valid unicode")]
|
||||||
InvalidUnicodeOutPath,
|
InvalidUnicodeOutPath,
|
||||||
|
|
||||||
|
#[error(
|
||||||
|
"conduit_compat config option must be enabled to migrate database to \
|
||||||
|
or from conduit. Note that you cannot currently enable \
|
||||||
|
conduit_compat on a database that was originally created in \
|
||||||
|
grapevine with it disabled."
|
||||||
|
)]
|
||||||
|
ConduitCompatDisabled,
|
||||||
|
|
||||||
#[error(
|
#[error(
|
||||||
"migrating a database may lose data even if the migration is \
|
"migrating a database may lose data even if the migration is \
|
||||||
successful. Because of this, it is very important to ensure you have \
|
successful. Because of this, it is very important to ensure you have \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue