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

Fix error when using synapse_port_db on a vanilla synapse db #6449

Merged
merged 3 commits into from
Dec 4, 2019
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/6449.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix assumed missing state_groups index in synapse_port_db.
anoadragon453 marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 4 additions & 1 deletion scripts/synapse_port_db
Original file line number Diff line number Diff line change
Expand Up @@ -782,7 +782,10 @@ class Porter(object):
def _setup_state_group_id_seq(self):
def r(txn):
txn.execute("SELECT MAX(id) FROM state_groups")
next_id = txn.fetchone()[0] + 1
curr_id = txn.fetchone()[0]
if not curr_id:
return
next_id = curr_id + 1
txn.execute("ALTER SEQUENCE state_group_id_seq RESTART WITH %s", (next_id,))

return self.postgres_store.runInteraction("setup_state_group_id_seq", r)
Expand Down