Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Handle updating schema version without any deltas. #9033

Merged
merged 3 commits into from
Jan 7, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/9033.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Allow bumping schema version when using split out state database.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this as misc, rather than bugfix, as this doesn't effect anyone other than synapse devs.

9 changes: 4 additions & 5 deletions synapse/storage/prepare_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,10 @@ def _upgrade_existing_database(
(v, relative_path),
)

cur.execute("DELETE FROM schema_version")
cur.execute(
"INSERT INTO schema_version (version, upgraded) VALUES (?,?)",
(v, True),
)
cur.execute("DELETE FROM schema_version")
cur.execute(
"INSERT INTO schema_version (version, upgraded) VALUES (?,?)", (v, True),
)
erikjohnston marked this conversation as resolved.
Show resolved Hide resolved

logger.info("Schema now up to date")

Expand Down