diff options
author | David Baker <dave@matrix.org> | 2016-04-29 10:05:20 +0100 |
---|---|---|
committer | David Baker <dave@matrix.org> | 2016-04-29 10:05:20 +0100 |
commit | acded821c4ff9da11ce7f916ca8b0f369bcb4e87 (patch) | |
tree | 6a797cfae11a8cf64277ff878c090d7905db9d19 /synapse/storage/room.py | |
parent | Remove vector specific style (diff) | |
parent | Fix more typos in per-request metrics (diff) | |
download | synapse-acded821c4ff9da11ce7f916ca8b0f369bcb4e87.tar.xz |
Merge remote-tracking branch 'origin/develop' into dbkr/email_notifs
Diffstat (limited to 'synapse/storage/room.py')
-rw-r--r-- | synapse/storage/room.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py index 9be977f387..70aa64fb31 100644 --- a/synapse/storage/room.py +++ b/synapse/storage/room.py @@ -169,20 +169,28 @@ class RoomStore(SQLBaseStore): def _store_event_search_txn(self, txn, event, key, value): if isinstance(self.database_engine, PostgresEngine): sql = ( - "INSERT INTO event_search (event_id, room_id, key, vector)" - " VALUES (?,?,?,to_tsvector('english', ?))" + "INSERT INTO event_search" + " (event_id, room_id, key, vector, stream_ordering, origin_server_ts)" + " VALUES (?,?,?,to_tsvector('english', ?),?,?)" + ) + txn.execute( + sql, + ( + event.event_id, event.room_id, key, value, + event.internal_metadata.stream_ordering, + event.origin_server_ts, + ) ) elif isinstance(self.database_engine, Sqlite3Engine): sql = ( "INSERT INTO event_search (event_id, room_id, key, value)" " VALUES (?,?,?,?)" ) + txn.execute(sql, (event.event_id, event.room_id, key, value,)) else: # This should be unreachable. raise Exception("Unrecognized database engine") - txn.execute(sql, (event.event_id, event.room_id, key, value,)) - @cachedInlineCallbacks() def get_room_name_and_aliases(self, room_id): def f(txn): |