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

Commit

Permalink
Fix port script fails when DB has no backfilled events.
Browse files Browse the repository at this point in the history
Fixes #8618
  • Loading branch information
erikjohnston committed Nov 6, 2020
1 parent 2a6b685 commit c646698
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/synapse_port_db
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ class Porter(object):
"ALTER SEQUENCE events_stream_seq RESTART WITH %s", (next_id,)
)

txn.execute("SELECT -MIN(stream_ordering) FROM events")
txn.execute("SELECT GREATEST(-MIN(stream_ordering), 1) FROM events")
curr_id = txn.fetchone()[0]
if curr_id:
next_id = curr_id + 1
Expand Down

0 comments on commit c646698

Please sign in to comment.