summary refs log tree commit diff
path: root/synapse/storage/schema
diff options
context:
space:
mode:
authorDaniel Wagner-Hall <dawagner@gmail.com>2016-03-08 17:45:46 +0000
committerDaniel Wagner-Hall <dawagner@gmail.com>2016-03-08 17:45:46 +0000
commitb117f67227c6011da088d20d799c226ea951102e (patch)
tree3f4d437943e53a3f4be2d6626f0585d471c0cb7f /synapse/storage/schema
parentMerge pull request #630 from matrix-org/dbkr/post_urlencoded_encode_params (diff)
parentMerge branch 'develop' into daniel/ick (diff)
downloadsynapse-b117f67227c6011da088d20d799c226ea951102e.tar.xz
Merge pull request #633 from matrix-org/daniel/ick
Idempotent-ise schema update script
Diffstat (limited to 'synapse/storage/schema')
-rw-r--r--synapse/storage/schema/delta/30/as_users.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/synapse/storage/schema/delta/30/as_users.py b/synapse/storage/schema/delta/30/as_users.py
index 4cf4dd0917..4da3c59de2 100644
--- a/synapse/storage/schema/delta/30/as_users.py
+++ b/synapse/storage/schema/delta/30/as_users.py
@@ -20,7 +20,11 @@ logger = logging.getLogger(__name__)
 
 def run_upgrade(cur, database_engine, config, *args, **kwargs):
     # NULL indicates user was not registered by an appservice.
-    cur.execute("ALTER TABLE users ADD COLUMN appservice_id TEXT")
+    try:
+        cur.execute("ALTER TABLE users ADD COLUMN appservice_id TEXT")
+    except:
+        # Maybe we already added the column? Hope so...
+        pass
 
     cur.execute("SELECT name FROM users")
     rows = cur.fetchall()