diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-09-07 15:06:46 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-09-07 15:06:46 +0100 |
commit | 73e4ad4b8b24bb99a8ede4bda8ac2263b68cad5e (patch) | |
tree | 268463223a4dbed35244b83ffb7b767330f8416e /scripts/synapse_port_db | |
parent | update logger to match new ambiguous script name... (diff) | |
parent | DEPENDENCY_LINKS was turned to a list (diff) | |
download | synapse-73e4ad4b8b24bb99a8ede4bda8ac2263b68cad5e.tar.xz |
Merge branch 'master' into develop
Conflicts: setup.py
Diffstat (limited to 'scripts/synapse_port_db')
-rwxr-xr-x | scripts/synapse_port_db | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/scripts/synapse_port_db b/scripts/synapse_port_db index c241fdec5a..6aba72e459 100755 --- a/scripts/synapse_port_db +++ b/scripts/synapse_port_db @@ -412,14 +412,17 @@ class Porter(object): self._convert_rows("sent_transactions", headers, 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): - self.postgres_store.insert_many_txn( - txn, "sent_transactions", headers[1:], rows - ) + def insert(txn): + self.postgres_store.insert_many_txn( + 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): txn.execute( |