This commit is contained in:
Матвей
2026-11-07 13:15:01 +03:00
parent 20afc2c790
commit eafb825657
93 changed files with 7549 additions and 1 deletions
+12
View File
@@ -0,0 +1,12 @@
CREATE TABLE idempotency_records (
user_id uuid NOT NULL REFERENCES users(id) ON DELETE CASCADE,
method varchar(8) NOT NULL,
path text NOT NULL,
idempotency_key varchar(128) NOT NULL,
request_hash char(64) NOT NULL,
message_id uuid REFERENCES messages(id) ON DELETE RESTRICT,
created_at timestamptz NOT NULL DEFAULT now(),
PRIMARY KEY (user_id, method, path, idempotency_key)
);
CREATE INDEX idempotency_records_created_at_idx ON idempotency_records (created_at);