This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #211 from matrix-org/email_in_use
Changes for unique emails
- Loading branch information
Showing
5 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
CREATE TABLE IF NOT EXISTS user_threepids2 ( | ||
user_id TEXT NOT NULL, | ||
medium TEXT NOT NULL, | ||
address TEXT NOT NULL, | ||
validated_at BIGINT NOT NULL, | ||
added_at BIGINT NOT NULL, | ||
CONSTRAINT medium_address UNIQUE (medium, address) | ||
); | ||
|
||
INSERT INTO user_threepids2 | ||
SELECT * FROM user_threepids WHERE added_at IN ( | ||
SELECT max(added_at) FROM user_threepids GROUP BY medium, address | ||
) | ||
; | ||
|
||
DROP TABLE user_threepids; | ||
ALTER TABLE user_threepids2 RENAME TO user_threepids; | ||
|
||
CREATE INDEX user_threepids_user_id ON user_threepids(user_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters