diff --git a/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/membership_table.go b/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/membership_table.go index c8a4f9637..07d1fd293 100644 --- a/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/membership_table.go +++ b/src/github.com/matrix-org/dendrite/clientapi/auth/storage/accounts/membership_table.go @@ -27,11 +27,9 @@ CREATE TABLE IF NOT EXISTS memberships ( -- The room this user is a member of room_id TEXT NOT NULL, + -- A user can only be member of a room once PRIMARY KEY (localpart, room_id) ); - --- A user can only be member of a room once -CREATE UNIQUE INDEX IF NOT EXISTS localpart_id_idx ON memberships(localpart, room_id); ` const insertMembershipSQL = "" +