summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-08 16:11:19 +0100
committerErik Johnston <erik@matrix.org>2015-05-08 16:11:19 +0100
commit724bb1e7d9c986efbddd2b6ad4dd978213a21c7f (patch)
treef07d747ac3f5e86b5efdd04c635531fda6ae4c79 /scripts
parentDrop the old table not the new table (diff)
parentMerge branch 'hotfixes-v0.9.0-r1' of github.com:matrix-org/synapse (diff)
downloadsynapse-724bb1e7d9c986efbddd2b6ad4dd978213a21c7f.tar.xz
Merge branch 'master' of github.com:matrix-org/synapse into develop
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/port_from_sqlite_to_postgres.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/port_from_sqlite_to_postgres.py b/scripts/port_from_sqlite_to_postgres.py

index f98342db51..e7ed4c309b 100755 --- a/scripts/port_from_sqlite_to_postgres.py +++ b/scripts/port_from_sqlite_to_postgres.py
@@ -106,7 +106,7 @@ class Store(object): try: txn = conn.cursor() return func( - LoggingTransaction(txn, desc, self.database_engine), + LoggingTransaction(txn, desc, self.database_engine, []), *args, **kwargs ) except self.database_engine.module.DatabaseError as e: @@ -378,9 +378,7 @@ class Porter(object): for i, row in enumerate(rows): rows[i] = tuple( - self.postgres_store.database_engine.encode_parameter( - conv(j, col) - ) + conv(j, col) for j, col in enumerate(row) if j > 0 ) @@ -725,6 +723,9 @@ if __name__ == "__main__": postgres_config = yaml.safe_load(args.postgres_config) + if "database" in postgres_config: + postgres_config = postgres_config["database"] + if "name" not in postgres_config: sys.stderr.write("Malformed database config: no 'name'") sys.exit(2)