Skip to content

Commit c58a660

Browse files
committed
fixed database errors
1 parent bbadb5f commit c58a660

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

database/setup.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ CREATE TABLE Users (
1010
DROP TABLE IF EXISTS Questions;
1111
CREATE TABLE Questions (
1212
qid SERIAL PRIMARY KEY,
13-
cid FOREIGN KEY references Competitions(cid),
13+
FOREIGN (cid) KEY references Competitions(cid),
1414
numParts INTEGER NOT NULL,
1515
name TEXT NOT NULL,
1616
pixelArtLine TEXT NOT NULL,
@@ -19,7 +19,7 @@ CREATE TABLE Questions (
1919

2020
DROP TABLE IF EXISTS Parts;
2121
CREATE TABLE Parts (
22-
qid FOREIGN KEY references Questions(qid),
22+
FOREIGN KEY (qid) references Questions(qid),
2323
description TEXT NOT NULL,
2424
partNum INTEGER NOT NULL,
2525
numSolved INTEGER NOT NULL,
@@ -38,8 +38,8 @@ CREATE TABLE Competitions (
3838
DROP TABLE IF EXISTS Inputs;
3939
CREATE TABLE Inputs (
4040
iid SERIAL PRIMARY KEY,
41-
qid FOREIGN KEY references Questions(qid),
42-
uid FOREIGN KEY references Users(id),
41+
FOREIGN KEY (qid) references Questions(qid),
42+
FOREIGN KEY (uid) references Users(id),
4343
input TEXT NOT NULL,
4444
solution TEXT NOT NULL
4545
);

0 commit comments

Comments
 (0)