CREATE TABLE etsy_oauth_requests ( account_id INTEGER NOT NULL, state BYTEA NOT NULL, code_verifier BYTEA NOT NULL, expiration TIMESTAMPTZ NOT NULL, PRIMARY KEY (state), FOREIGN KEY (account_id) REFERENCES accounts ); CREATE UNIQUE INDEX ON etsy_oauth_requests (state);