Добавить X-Instance-Id, обязательный Idempotency-Key и мягкую остановку API
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
CREATE TABLE idempotency_keys (
|
||||
user_id uuid NOT NULL REFERENCES users (id),
|
||||
scope text NOT NULL,
|
||||
key text NOT NULL CHECK (key ~ '^[A-Za-z0-9._:-]{1,128}$'),
|
||||
request_hash bytea NOT NULL CHECK (octet_length(request_hash) = 32),
|
||||
message_id uuid REFERENCES messages (id),
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
PRIMARY KEY (user_id, scope, key)
|
||||
);
|
||||
|
||||
CREATE INDEX idempotency_keys_created_idx ON idempotency_keys (created_at);
|
||||
Reference in New Issue
Block a user