mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-14 14:05:24 -04:00
Don't use multiple UNIQUE constraints; it will cause deadlocks
This commit is contained in:
parent
c8d3f6486d
commit
0af5f5efaf
4 changed files with 17 additions and 15 deletions
|
@ -35,8 +35,8 @@ CREATE TABLE IF NOT EXISTS user_ips (
|
|||
device_id VARCHAR(150),
|
||||
ip VARCHAR(150) NOT NULL,
|
||||
user_agent VARCHAR(150) NOT NULL,
|
||||
last_seen BIGINT NOT NULL,
|
||||
UNIQUE (user, access_token, ip, user_agent)
|
||||
last_seen BIGINT NOT NULL
|
||||
) ;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS user_ips_user ON user_ips(user);
|
||||
CREATE INDEX IF NOT EXISTS user_ips_user_ip ON user_ips(user, access_token, ip);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue