summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-04-29 13:55:44 +0100
committerErik Johnston <erik@matrix.org>2015-04-29 13:55:44 +0100
commit970a9b9d2bda3960eb755ed6922540ab9e2d2606 (patch)
treef8bfb99bd088a22f1781e0ac79ff6f8c7b8148a6 /synapse/storage
parentMerge pull request #129 from matrix-org/key_distribution (diff)
downloadsynapse-970a9b9d2bda3960eb755ed6922540ab9e2d2606.tar.xz
We can't use REPLACE when upgrading databases now we have postgres
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/__init__.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 6a82d7fcf8..2773b2cb13 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -368,9 +368,10 @@ def _upgrade_existing_database(cur, current_version, applied_delta_files,
                 (v, relative_path)
             )
 
+            cur.execute("DELETE FROM schema_version")
             cur.execute(
                 database_engine.convert_param_style(
-                    "REPLACE INTO schema_version (version, upgraded)"
+                    "INSERT INTO schema_version (version, upgraded)"
                     " VALUES (?,?)",
                 ),
                 (v, True)