feat: API replicas over HAProxy (3)

This commit is contained in:
2026-11-06 03:26:54 +03:00
parent de2f63b926
commit ec111aadfb
32 changed files with 396 additions and 147 deletions
@@ -0,0 +1,9 @@
CREATE TABLE message_idempotency (
user_id uuid NOT NULL REFERENCES users (id),
chat_id uuid NOT NULL REFERENCES chats (id) ON DELETE CASCADE,
key text NOT NULL,
request_hash text NOT NULL,
message_id uuid NOT NULL REFERENCES messages (id) ON DELETE CASCADE DEFERRABLE INITIALLY DEFERRED,
created_at timestamptz NOT NULL,
PRIMARY KEY (user_id, chat_id, key)
);