summary refs log tree commit diff
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2015-04-29 16:57:14 +0100
committerDavid Baker <dave@matrix.org>2015-04-29 16:57:14 +0100
commit61cd5d9045b767e2c1ef4e48e67ed0c70e1092fe (patch)
tree75461d27eec103c4d726168c2e7312a8dfe6b8c9
parentBe postgressive (diff)
downloadsynapse-61cd5d9045b767e2c1ef4e48e67ed0c70e1092fe.tar.xz
Be more postgressive
-rw-r--r--synapse/storage/registration.py4
-rw-r--r--synapse/storage/schema/delta/17/user_threepids.sql4
2 files changed, 4 insertions, 4 deletions
diff --git a/synapse/storage/registration.py b/synapse/storage/registration.py
index a986c4816e..026ba217d6 100644
--- a/synapse/storage/registration.py
+++ b/synapse/storage/registration.py
@@ -181,7 +181,7 @@ class RegistrationStore(SQLBaseStore):
     @defer.inlineCallbacks
     def user_add_threepid(self, user_id, medium, address, validated_at, added_at):
         yield self._simple_upsert("user_threepids", {
-            "user": user_id,
+            "user_id": user_id,
             "medium": medium,
             "address": address,
         }, {
@@ -193,7 +193,7 @@ class RegistrationStore(SQLBaseStore):
     def user_get_threepids(self, user_id):
         ret = yield self._simple_select_list(
             "user_threepids", {
-                "user": user_id
+                "user_id": user_id
             },
             ['medium', 'address', 'validated_at', 'added_at'],
             'user_get_threepids'
diff --git a/synapse/storage/schema/delta/17/user_threepids.sql b/synapse/storage/schema/delta/17/user_threepids.sql
index bbb472ee8a..f3d1efe4e0 100644
--- a/synapse/storage/schema/delta/17/user_threepids.sql
+++ b/synapse/storage/schema/delta/17/user_threepids.sql
@@ -1,9 +1,9 @@
 CREATE TABLE user_threepids (
-    user TEXT NOT NULL,
+    user_id TEXT NOT NULL,
     medium TEXT NOT NULL,
     address TEXT NOT NULL,
     validated_at BIGINT NOT NULL,
     added_at BIGINT NOT NULL,
     CONSTRAINT user_medium_address UNIQUE (user, medium, address)
 );
-CREATE INDEX user_threepids_user ON user_threepids(user);
+CREATE INDEX user_threepids_user_id ON user_threepids(user_id);