Lab 4 for Grade 4

This commit is contained in:
paflove
2026-11-14 15:09:57 +03:00
parent ec540a1a72
commit 46251b361f
20 changed files with 1813 additions and 15 deletions
+12
View File
@@ -0,0 +1,12 @@
CREATE TABLE IF NOT EXISTS idempotency_keys (
user_id UUID NOT NULL REFERENCES users(id) ON DELETE CASCADE,
chat_id UUID NOT NULL REFERENCES chats(id) ON DELETE CASCADE,
key VARCHAR(128) NOT NULL,
request_hash VARCHAR(64) NOT NULL,
response_code INT NOT NULL,
response_body JSONB NOT NULL,
created_at TIMESTAMPTZ NOT NULL,
PRIMARY KEY (user_id, chat_id, key)
);
CREATE INDEX IF NOT EXISTS idx_idempotency_created_at ON idempotency_keys (created_at);