0
0
Fork 1
mirror of https://mau.dev/maunium/synapse.git synced 2024-11-15 22:42:23 +01:00

Make port script handle empty sent_transactions table

This commit is contained in:
Erik Johnston 2015-09-02 11:11:11 +01:00
parent 9c8eb4a809
commit a9ad647fb2

View file

@ -412,6 +412,7 @@ class Porter(object):
self._convert_rows("sent_transactions", headers, rows) self._convert_rows("sent_transactions", headers, rows)
inserted_rows = len(rows) inserted_rows = len(rows)
if inserted_rows:
max_inserted_rowid = max(r[0] for r in rows) max_inserted_rowid = max(r[0] for r in rows)
def insert(txn): def insert(txn):
@ -420,6 +421,8 @@ class Porter(object):
) )
yield self.postgres_store.execute(insert) yield self.postgres_store.execute(insert)
else:
max_inserted_rowid = 0
def get_start_id(txn): def get_start_id(txn):
txn.execute( txn.execute(