Fix possibility of extra mention insertion on nonce collision
This commit is contained in:
parent
b07f9fe3b5
commit
ac54d2b927
6 changed files with 204 additions and 171 deletions
|
@ -5,3 +5,7 @@ CREATE TABLE "channel_message_mentions" (
|
|||
"user_id" INTEGER NOT NULL REFERENCES users (id) ON DELETE CASCADE,
|
||||
PRIMARY KEY(message_id, start_offset)
|
||||
);
|
||||
|
||||
-- We use 'on conflict update' with this index, so it should be per-user.
|
||||
CREATE UNIQUE INDEX "index_channel_messages_on_sender_id_nonce" ON "channel_messages" ("sender_id", "nonce");
|
||||
DROP INDEX "index_channel_messages_on_nonce";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue