summary refs log tree commit diff
path: root/scripts/synapse_port_db
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-09-14 18:04:36 +0100
committerErik Johnston <erik@matrix.org>2015-09-14 18:04:36 +0100
commit228465b0ecfc7d7137ac3acaf30050e234957b6a (patch)
tree1e273d754bc819fecfb877e19a15a08b4d1e231a /scripts/synapse_port_db
parentOnly allow people to set the alias list for their own domain. (diff)
parentMerge pull request #265 from matrix-org/erikj/check_room_exists (diff)
downloadsynapse-github/erikj/check_alias.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/check_alias github/erikj/check_alias erikj/check_alias
Diffstat (limited to 'scripts/synapse_port_db')
-rwxr-xr-xscripts/synapse_port_db17
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/synapse_port_db b/scripts/synapse_port_db

index e7ed4c309b..6aba72e459 100755 --- a/scripts/synapse_port_db +++ b/scripts/synapse_port_db
@@ -29,7 +29,7 @@ import traceback import yaml -logger = logging.getLogger("port_from_sqlite_to_postgres") +logger = logging.getLogger("synapse_port_db") BOOLEAN_COLUMNS = { @@ -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(