Implement lab3 replicated API and experiment evidence

This commit is contained in:
Polusikkkk
2026-10-29 20:20:13 +03:00
parent 0ab3a341aa
commit 5847952e76
48 changed files with 4013 additions and 33 deletions
+22
View File
@@ -0,0 +1,22 @@
CREATE TABLE message_idempotency (
user_id UUID NOT NULL REFERENCES users(id),
chat_id UUID NOT NULL REFERENCES chats(id),
http_method TEXT NOT NULL DEFAULT 'POST',
idempotency_key TEXT NOT NULL,
request_text TEXT NOT NULL,
message_id UUID NOT NULL REFERENCES messages(id),
created_at TIMESTAMPTZ NOT NULL DEFAULT clock_timestamp(),
PRIMARY KEY (
user_id, chat_id, http_method, idempotency_key
),
CONSTRAINT message_idempotency_method
CHECK (http_method = 'POST'),
CONSTRAINT message_idempotency_key_format
CHECK (
char_length(idempotency_key) BETWEEN 1 AND 128
AND idempotency_key ~ '^[A-Za-z0-9._:-]+$'
)
);