summary refs log tree commit diff
path: root/synapse/storage
diff options
context:
space:
mode:
authorDavid Baker <dave@matrix.org>2016-01-04 14:05:37 +0000
committerDavid Baker <dave@matrix.org>2016-01-04 14:05:37 +0000
commitc914d67cda9682331639b78190db367974e4fb8b (patch)
treef0e72e559a381512d56c5027bcfeef19e80f8859 /synapse/storage
parentMerge remote-tracking branch 'origin/develop' into store_event_actions (diff)
downloadsynapse-c914d67cda9682331639b78190db367974e4fb8b.tar.xz
Rename event-actions to event_push_actions as per PR request
Diffstat (limited to 'synapse/storage')
-rw-r--r--synapse/storage/__init__.py4
-rw-r--r--synapse/storage/event_push_actions.py (renamed from synapse/storage/event_actions.py)20
-rw-r--r--synapse/storage/schema/delta/27/event_push_actions.sql (renamed from synapse/storage/schema/delta/27/event_actions.sql)4
3 files changed, 14 insertions, 14 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index a112dd237f..43e05f144a 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -33,7 +33,7 @@ from .pusher import PusherStore
 from .push_rule import PushRuleStore
 from .media_repository import MediaRepositoryStore
 from .rejections import RejectionsStore
-from .event_actions import EventActionsStore
+from .event_push_actions import EventPushActionsStore
 
 from .state import StateStore
 from .signatures import SignatureStore
@@ -76,7 +76,7 @@ class DataStore(RoomMemberStore, RoomStore,
                 SearchStore,
                 TagsStore,
                 AccountDataStore,
-                EventActionsStore
+                EventPushActionsStore
                 ):
 
     def __init__(self, hs):
diff --git a/synapse/storage/event_actions.py b/synapse/storage/event_push_actions.py
index fa9cbe71ee..016c0adf8a 100644
--- a/synapse/storage/event_actions.py
+++ b/synapse/storage/event_push_actions.py
@@ -22,9 +22,9 @@ import simplejson as json
 logger = logging.getLogger(__name__)
 
 
-class EventActionsStore(SQLBaseStore):
+class EventPushActionsStore(SQLBaseStore):
     @defer.inlineCallbacks
-    def set_actions_for_event_and_users(self, event, tuples):
+    def set_push_actions_for_event_and_users(self, event, tuples):
         """
         :param event: the event set actions for
         :param tuples: list of tuples of (user_id, profile_tag, actions)
@@ -42,15 +42,15 @@ class EventActionsStore(SQLBaseStore):
         yield self.runInteraction(
             "set_actions_for_event_and_users",
             self._simple_insert_many_txn,
-            EventActionsTable.table_name,
+            EventPushActionsTable.table_name,
             values
         )
 
     @defer.inlineCallbacks
-    def get_unread_event_actions_by_room_for_user(
+    def get_unread_event_push_actions_by_room_for_user(
             self, room_id, user_id, last_read_event_id
     ):
-        def _get_unread_event_actions_by_room(txn):
+        def _get_unread_event_push_actions_by_room(txn):
             sql = (
                 "SELECT stream_ordering, topological_ordering"
                 " FROM events"
@@ -68,7 +68,7 @@ class EventActionsStore(SQLBaseStore):
 
             sql = (
                 "SELECT ea.event_id, ea.actions"
-                " FROM event_actions ea, events e"
+                " FROM event_push_actions ea, events e"
                 " WHERE ea.room_id = e.room_id"
                 " AND ea.event_id = e.event_id"
                 " AND ea.user_id = ?"
@@ -88,11 +88,11 @@ class EventActionsStore(SQLBaseStore):
             ]
 
         ret = yield self.runInteraction(
-            "get_unread_event_actions_by_room",
-            _get_unread_event_actions_by_room
+            "get_unread_event_push_actions_by_room",
+            _get_unread_event_push_actions_by_room
         )
         defer.returnValue(ret)
 
 
-class EventActionsTable(object):
-    table_name = "event_actions"
+class EventPushActionsTable(object):
+    table_name = "event_push_actions"
diff --git a/synapse/storage/schema/delta/27/event_actions.sql b/synapse/storage/schema/delta/27/event_push_actions.sql
index bbdaee990e..bdf6ae3f24 100644
--- a/synapse/storage/schema/delta/27/event_actions.sql
+++ b/synapse/storage/schema/delta/27/event_push_actions.sql
@@ -13,7 +13,7 @@
  * limitations under the License.
  */
 
-CREATE TABLE IF NOT EXISTS event_actions(
+CREATE TABLE IF NOT EXISTS event_push_actions(
     room_id TEXT NOT NULL,
     event_id TEXT NOT NULL,
     user_id TEXT NOT NULL,
@@ -23,4 +23,4 @@ CREATE TABLE IF NOT EXISTS event_actions(
 );
 
 
-CREATE INDEX event_actions_room_id_event_id_user_id_profile_tag on event_actions(room_id, event_id, user_id, profile_tag);
+CREATE INDEX event_push_actions_room_id_event_id_user_id_profile_tag on event_push_actions(room_id, event_id, user_id, profile_tag);