This commit is contained in:
Getlles
2026-11-09 12:40:25 +03:00
parent b750ef2722
commit 234e2a2fd7
7 changed files with 251 additions and 103 deletions
+13 -1
View File
@@ -26,4 +26,16 @@ CREATE TABLE IF NOT EXISTS messages (
created_at TIMESTAMPTZ NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_messages_chat_pagination ON messages(chat_id, created_at, id);
CREATE INDEX IF NOT EXISTS idx_messages_chat_pagination ON messages(chat_id, created_at, id);
CREATE TABLE IF NOT EXISTS idempotency_keys (
user_id UUID NOT NULL,
method VARCHAR(16) NOT NULL,
path TEXT NOT NULL,
key VARCHAR(128) NOT NULL,
request_hash VARCHAR(64) NOT NULL,
response_status INT NOT NULL,
response_body JSONB NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
PRIMARY KEY (user_id, method, path, key)
);