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

10 lines
246 B
MySQL
Raw Normal View History

2020-06-24 21:34:53 +00:00
CREATE TABLE requests (
id int GENERATED ALWAYS AS IDENTITY,
url varchar UNIQUE,
requester varchar NOT NULL,
score int DEFAULT 0,
state varchar NOT NULL DEFAULT 'Requested',
PRIMARY KEY(id),
FOREIGN KEY (state) REFERENCES states(state)
);