mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2024-11-10 10:49:35 +00:00
14 lines
No EOL
376 B
SQL
14 lines
No EOL
376 B
SQL
CREATE TYPE header_pair AS (
|
|
name TEXT,
|
|
value BYTEA
|
|
);
|
|
|
|
CREATE TABLE idempotency (
|
|
user_id uuid NOT NULL REFERENCES users(user_id),
|
|
idempotency_key TEXT NOT NULL,
|
|
response_status_code SMALLINT NOT NULL,
|
|
response_headers header_pair[] NOT NULL,
|
|
response_body BYTEA NOT NULL,
|
|
created_at timestamptz NOT NULL,
|
|
PRIMARY KEY(user_id, idempotency_key)
|
|
); |