From 6f0f922fad04742a2c843272a75909384ae302cf Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Wed, 20 Sep 2017 14:23:31 +0100 Subject: [PATCH] Fix SQL --- .../dendrite/syncapi/storage/invites_table.go | 12 +++++++----- .../syncapi/storage/output_room_events_table.go | 1 - 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/syncapi/storage/invites_table.go b/src/github.com/matrix-org/dendrite/syncapi/storage/invites_table.go index 68ca4168c..68087244d 100644 --- a/src/github.com/matrix-org/dendrite/syncapi/storage/invites_table.go +++ b/src/github.com/matrix-org/dendrite/syncapi/storage/invites_table.go @@ -5,7 +5,6 @@ import ( "database/sql" "github.com/matrix-org/dendrite/common" - "github.com/matrix-org/gomatrixserverlib" ) @@ -15,13 +14,16 @@ CREATE TABLE IF NOT EXISTS syncapi_invite_events ( event_id TEXT NOT NULL, room_id TEXT NOT NULL, target_user_id TEXT NOT NULL, - event_json TEXT NOT NULL, + event_json TEXT NOT NULL ); -- For looking up the invites for a given user. -CREATE INDEX IF NOT EXISTS syncapi_target_user_id_idx - ON syncapi_invite_events (target_user_id, id) -); +CREATE INDEX IF NOT EXISTS syncapi_invites_target_user_id_idx + ON syncapi_invite_events (target_user_id, id); + +-- For deleting old invites +CREATE INDEX IF NOT EXISTS syncapi_invites_event_id_idx + ON syncapi_invite_events(target_user_id, id); ` const insertInviteEventSQL = "" + diff --git a/src/github.com/matrix-org/dendrite/syncapi/storage/output_room_events_table.go b/src/github.com/matrix-org/dendrite/syncapi/storage/output_room_events_table.go index 7a55d3ee5..ac6e3d7f3 100644 --- a/src/github.com/matrix-org/dendrite/syncapi/storage/output_room_events_table.go +++ b/src/github.com/matrix-org/dendrite/syncapi/storage/output_room_events_table.go @@ -30,7 +30,6 @@ const outputRoomEventsSchema = ` CREATE SEQUENCE IF NOT EXISTS syncapi_stream_id; -- Stores output room events received from the roomserver. -CREATE SEQUENCE IF NOT EXISTS syncapi_output_room_event_id_seq CREATE TABLE IF NOT EXISTS syncapi_output_room_events ( -- An incrementing ID which denotes the position in the log that this event resides at. -- NB: 'serial' makes no guarantees to increment by 1 every time, only that it increments.