feat: port verified messenger from lab 6

This commit is contained in:
Dmitrii Grishko
2026-11-14 19:16:28 +03:00
parent 20afc2c790
commit e3d7df4e72
142 changed files with 13702 additions and 0 deletions
@@ -0,0 +1,8 @@
CREATE TABLE message_idempotency (
sender_id uuid NOT NULL REFERENCES users(id),
chat_id uuid NOT NULL REFERENCES chats(id),
key varchar(128) NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
message_id uuid NOT NULL REFERENCES messages(id),
expires_at timestamptz NOT NULL,
PRIMARY KEY (sender_id, chat_id, key)
);