Fix bug where we clobbered old state group values

This commit is contained in:
Erik Johnston 2014-12-10 15:55:03 +00:00
parent cabead6194
commit 1d2a0040cf
3 changed files with 13 additions and 2 deletions

View file

@ -220,7 +220,8 @@ class DataStore(RoomMemberStore, RoomStore,
room_id=event.room_id,
)
self._store_state_groups_txn(txn, event, context)
if not outlier:
self._store_state_groups_txn(txn, event, context)
if current_state:
txn.execute(

View file

@ -29,7 +29,8 @@ CREATE TABLE IF NOT EXISTS state_groups_state(
CREATE TABLE IF NOT EXISTS event_to_state_groups(
event_id TEXT NOT NULL,
state_group INTEGER NOT NULL
state_group INTEGER NOT NULL,
CONSTRAINT event_to_state_groups_uniq UNIQUE (event_id)
);
CREATE INDEX IF NOT EXISTS state_groups_id ON state_groups(id);