summary refs log tree commit diff
path: root/synapse/storage/__init__.py
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-27 11:14:11 +0000
committerMark Haines <mark.haines@matrix.org>2014-10-27 11:14:11 +0000
commitacb2d171e88f7e5a60f6468e5b4f39fdb1ce94a3 (patch)
tree98b171bd5303e03ee123708f6ed96932f29db558 /synapse/storage/__init__.py
parentAdd script to hash exisitng history (diff)
parentTest pyflakes jenikns integration (diff)
downloadsynapse-acb2d171e88f7e5a60f6468e5b4f39fdb1ce94a3.tar.xz
Merge branch 'develop' into event_signing
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index e4f708b6ad..1639e2c973 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -70,7 +70,7 @@ SCHEMAS = [
 
 # Remember to update this number every time an incompatible change is made to
 # database schema files, so the users will be informed on server restarts.
-SCHEMA_VERSION = 5
+SCHEMA_VERSION = 6
 
 
 class _RollbackButIsFineException(Exception):
@@ -487,10 +487,11 @@ def prepare_database(db_conn):
             db_conn.commit()
 
     else:
+        sql_script = "BEGIN TRANSACTION;"
         for sql_loc in SCHEMAS:
-            sql_script = read_schema(sql_loc)
-
-            c.executescript(sql_script)
+            sql_script += read_schema(sql_loc)
+        sql_script += "COMMIT TRANSACTION;"
+        c.executescript(sql_script)
         db_conn.commit()
         c.execute("PRAGMA user_version = %d" % SCHEMA_VERSION)