forked from mtusi2026/mtusi2026lab3
13 lines
469 B
SQL
13 lines
469 B
SQL
CREATE TABLE IF NOT EXISTS idempotency_keys (
|
|
user_id uuid NOT NULL,
|
|
method text NOT NULL,
|
|
path text NOT NULL,
|
|
key text NOT NULL,
|
|
request_hash text NOT NULL,
|
|
status_code int,
|
|
response_body jsonb,
|
|
message_id uuid,
|
|
created_at timestamptz NOT NULL DEFAULT now(),
|
|
PRIMARY KEY (user_id, method, path, key)
|
|
);
|
|
CREATE INDEX IF NOT EXISTS idempotency_created_idx ON idempotency_keys (created_at); |