Skip to content
Snippets Groups Projects
Commit a9ad647f authored by Erik Johnston's avatar Erik Johnston
Browse files

Make port script handle empty sent_transactions table

parent 9c8eb4a8
No related branches found
No related tags found
No related merge requests found
...@@ -412,14 +412,17 @@ class Porter(object): ...@@ -412,14 +412,17 @@ 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)
max_inserted_rowid = max(r[0] for r in rows) if inserted_rows:
max_inserted_rowid = max(r[0] for r in rows)
def insert(txn): def insert(txn):
self.postgres_store.insert_many_txn( self.postgres_store.insert_many_txn(
txn, "sent_transactions", headers[1:], rows txn, "sent_transactions", headers[1:], rows
) )
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(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment