summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-05-12 13:10:42 +0100
committerErik Johnston <erik@matrix.org>2015-05-12 13:10:42 +0100
commitda6a7bbdde73c5182a08a8f6253dc77761d9fc5f (patch)
treede515e4104613e4abbe0f523904f055078fc48af /scripts
parentFix up leak. Add warnings. (diff)
parentMerge pull request #148 from matrix-org/bugs/SYN-377 (diff)
downloadsynapse-da6a7bbdde73c5182a08a8f6253dc77761d9fc5f.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into erikj/logging_context
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)