mirror of
https://mau.dev/mautrix/go.git
synced 2026-03-14 14:25:53 +01:00
bridgev2/database: delete duplicate mxids in migration
This commit is contained in:
parent
41213c6230
commit
ff4126b5d0
1 changed files with 1 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
-- v17 (compatible with v9+): Add unique constraint for message and reaction mxids
|
||||
DELETE FROM message WHERE mxid IN (SELECT mxid FROM message GROUP BY mxid HAVING COUNT(*) > 1);
|
||||
-- only: postgres for next 2 lines
|
||||
ALTER TABLE message ADD CONSTRAINT message_mxid_unique UNIQUE (bridge_id, mxid);
|
||||
ALTER TABLE reaction ADD CONSTRAINT reaction_mxid_unique UNIQUE (bridge_id, mxid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue