Complete Lab 5 for Grade 4

This commit is contained in:
paflove
2026-11-23 17:20:36 +03:00
parent 276dbdad8a
commit 93744ea8d0
26 changed files with 2568 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);