feat: port lab3 implementation

This commit is contained in:
kk10
2026-10-31 11:54:18 +03:00
parent ec540a1a72
commit 27af30c903
83 changed files with 5195 additions and 6 deletions
@@ -0,0 +1,17 @@
-- +goose Up
CREATE TABLE idempotency_keys (
user_id uuid NOT NULL REFERENCES users (id) ON DELETE CASCADE,
method text NOT NULL,
path text NOT NULL,
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 DEFAULT now(),
PRIMARY KEY (user_id, method, path, key)
);
CREATE INDEX idx_idempotency_keys_created_at ON idempotency_keys (created_at);
-- +goose Down
DROP TABLE idempotency_keys;