zero-to-axum/migrations/20250718155413_create-idempotency-table.sql

14 lines
352 B
SQL

CREATE TYPE header_pair AS (
name TEXT,
value BYTEA
);
CREATE TABLE idempotency (
user_id UUID NOT NULL REFERENCES users(id),
nonce TEXT NOT NULL,
response_code SMALLINT NOT NULL,
response_headers header_pair[] NOT NULL,
response_body BYTEA NOT NULL,
created_at timestamptz NOT NULL,
PRIMARY KEY(user_id, nonce)
);