From 0874fd419c474e492ec8f6a99cf95352ef10e9f6 Mon Sep 17 00:00:00 2001 From: finn Date: Wed, 27 Jul 2022 12:48:06 -0700 Subject: [PATCH] Allow sharded database in db migrate script Signed-off-by: Finn Herzfeld --- changelog.d/13422.bugfix | 1 + synapse/_scripts/update_synapse_database.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelog.d/13422.bugfix diff --git a/changelog.d/13422.bugfix b/changelog.d/13422.bugfix new file mode 100644 index 000000000000..347104e0bb66 --- /dev/null +++ b/changelog.d/13422.bugfix @@ -0,0 +1 @@ +let update_synapse_database run in configurations with multiple databases. Contributed by @thefinn93 @ Beeper. \ No newline at end of file diff --git a/synapse/_scripts/update_synapse_database.py b/synapse/_scripts/update_synapse_database.py index b4aeae6dd5b8..d0e227fa15d0 100755 --- a/synapse/_scripts/update_synapse_database.py +++ b/synapse/_scripts/update_synapse_database.py @@ -97,8 +97,8 @@ def main() -> None: # Load, process and sanity-check the config. hs_config = yaml.safe_load(args.database_config) - if "database" not in hs_config: - sys.stderr.write("The configuration file must have a 'database' section.\n") + if "database" not in hs_config and "databases" not in hs_config: + sys.stderr.write("The configuration file must have a 'database' or 'databases' section.\n") sys.exit(4) config = HomeServerConfig()