From 5874ac5898c6eb9fb6f028573e3fbf44cd1c945a Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 7 Feb 2017 17:17:56 +0000 Subject: [PATCH] Fix whitespace and more comments --- .../dendrite/roomserver/input/events.go | 2 +- .../dendrite/roomserver/storage/sql.go | 20 ++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/roomserver/input/events.go b/src/github.com/matrix-org/dendrite/roomserver/input/events.go index 515045348..dfeff9536 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/input/events.go +++ b/src/github.com/matrix-org/dendrite/roomserver/input/events.go @@ -27,7 +27,7 @@ func processRoomEvent(db RoomEventDatabase, input api.InputRoomEvent) error { if input.Kind == api.KindOutlier { // For outliers we can stop after we've stored the event itself as it // doesn't have any associated state to store and we don't need to - // notify anyone it. + // notify anyone about it. return nil } diff --git a/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go b/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go index 799c5ef67..0a3d6b573 100644 --- a/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go +++ b/src/github.com/matrix-org/dendrite/roomserver/storage/sql.go @@ -65,13 +65,13 @@ func (s *statements) preparePartitionOffsets(db *sql.DB) (err error) { const partitionOffsetsSchema = ` -- The offsets that the server has processed up to. CREATE TABLE IF NOT EXISTS partition_offsets ( - -- The name of the topic. - topic TEXT NOT NULL, - -- The 32-bit partition ID - partition INTEGER NOT NULL, - -- The 64-bit offset. - partition_offset BIGINT NOT NULL, - CONSTRAINT topic_partition_unique UNIQUE (topic, partition) + -- The name of the topic. + topic TEXT NOT NULL, + -- The 32-bit partition ID + partition INTEGER NOT NULL, + -- The 64-bit offset. + partition_offset BIGINT NOT NULL, + CONSTRAINT topic_partition_unique UNIQUE (topic, partition) ); ` @@ -292,11 +292,13 @@ CREATE TABLE IF NOT EXISTS events ( -- Local numeric ID for the event. event_nid BIGINT PRIMARY KEY DEFAULT nextval('event_nid_seq'), -- Local numeric ID for the room the event is in. + -- This is never 0. room_nid BIGINT NOT NULL, - -- Local numeric ID for the type of the event. + -- Local numeric ID for the type of the event. + -- This is never 0. event_type_nid BIGINT NOT NULL, -- Local numeric ID for the state_key of the event - -- This is 0 if the event is not a state event. + -- This is 0 if the event is not a state event. event_state_key_nid BIGINT NOT NULL, -- The textual event id. -- Used to lookup the numeric ID when processing requests.