mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Fix error when using synapse_port_db on a vanilla synapse db (#6449)
This commit is contained in:
commit
85901939c1
1
changelog.d/6449.bugfix
Normal file
1
changelog.d/6449.bugfix
Normal file
@ -0,0 +1 @@
|
|||||||
|
Fix error when using synapse_port_db on a vanilla synapse db.
|
@ -782,7 +782,10 @@ class Porter(object):
|
|||||||
def _setup_state_group_id_seq(self):
|
def _setup_state_group_id_seq(self):
|
||||||
def r(txn):
|
def r(txn):
|
||||||
txn.execute("SELECT MAX(id) FROM state_groups")
|
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,))
|
txn.execute("ALTER SEQUENCE state_group_id_seq RESTART WITH %s", (next_id,))
|
||||||
|
|
||||||
return self.postgres_store.runInteraction("setup_state_group_id_seq", r)
|
return self.postgres_store.runInteraction("setup_state_group_id_seq", r)
|
||||||
|
Loading…
Reference in New Issue
Block a user