mirror of
https://github.com/element-hq/synapse.git
synced 2025-03-14 11:48:44 +00:00
Make port script aware of handle_state_group_seq
This commit is contained in:
parent
a81bcae7db
commit
3c62aac038
1 changed files with 16 additions and 0 deletions
|
@ -425,6 +425,20 @@ class Porter(object):
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def handle_state_group_seq(self):
|
||||||
|
"""Updates postgres handle_state_group_seq with last state_group ID
|
||||||
|
"""
|
||||||
|
def handle_state_group_seq_txn(txn):
|
||||||
|
txn.execute("""
|
||||||
|
SELECT setval('state_group_id_seq',
|
||||||
|
SELECT COALESCE(MAX(id), 0) FROM state_groups
|
||||||
|
)
|
||||||
|
""")
|
||||||
|
|
||||||
|
return self.postgres_store.runInteraction(
|
||||||
|
"handle_state_group_seq", handle_state_group_seq_txn,
|
||||||
|
)
|
||||||
|
|
||||||
def setup_db(self, db_config, database_engine):
|
def setup_db(self, db_config, database_engine):
|
||||||
db_conn = database_engine.module.connect(
|
db_conn = database_engine.module.connect(
|
||||||
**{
|
**{
|
||||||
|
@ -548,6 +562,8 @@ class Porter(object):
|
||||||
consumeErrors=True,
|
consumeErrors=True,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
yield self.handle_state_group_seq()
|
||||||
|
|
||||||
self.progress.done()
|
self.progress.done()
|
||||||
except:
|
except:
|
||||||
global end_error_exec_info
|
global end_error_exec_info
|
||||||
|
|
Loading…
Add table
Reference in a new issue