learn-request-queue/db/30-votes.sql

8 lines
245 B
MySQL
Raw Permalink Normal View History

2020-08-08 04:32:06 +00:00
CREATE TABLE votes (
requestUrl varchar NOT NULL,
userId int NOT NULL,
2020-08-08 04:32:06 +00:00
PRIMARY KEY (requestUrl,userId),
2020-11-01 20:07:16 +00:00
FOREIGN KEY (requestUrl) REFERENCES requests(url) ON DELETE CASCADE,
FOREIGN KEY (userId) REFERENCES users(userId) ON DELETE CASCADE
2020-08-08 04:32:06 +00:00
);