From 4e2ffe79a4406616990eac1a00682f08d668218a Mon Sep 17 00:00:00 2001
From: Erik Johnston <erik@matrix.org>
Date: Wed, 26 Nov 2014 15:17:08 +0000
Subject: [PATCH] Don't delete the entire current_state_events table

---
 synapse/storage/__init__.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 1fb33171e8..f15e3dfe62 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -209,7 +209,10 @@ class DataStore(RoomMemberStore, RoomStore,
         self._store_state_groups_txn(txn, event)
 
         if current_state:
-            txn.execute("DELETE FROM current_state_events")
+            txn.execute(
+                "DELETE FROM current_state_events WHERE room_id = ?",
+                (event.room_id,)
+            )
 
             for s in current_state:
                 self._simple_insert_txn(
-- 
GitLab