learn-request-queue/db/20-requests.sql

10 lines
287 B
SQL

CREATE TABLE requests (
url varchar NOT NULL,
requester int NOT NULL,
state varchar NOT NULL DEFAULT 'Requested',
reqTimestamp timestamptz NOT NULL DEFAULT NOW(),
PRIMARY KEY (url),
FOREIGN KEY (requester) REFERENCES users(userid),
FOREIGN KEY (state) REFERENCES states(state)
);