Add foreign keys to databases.

This commit is contained in:
Gonne 2023-07-16 13:25:34 +02:00
parent 4ea0471683
commit 9632545d94
2 changed files with 35 additions and 26 deletions

View file

@ -18,7 +18,8 @@ CREATE TABLE `request` (
`id` INTEGER PRIMARY KEY,
`officeHour` int DEFAULT NULL,
`action` int DEFAULT NULL,
`secret` text DEFAULT NULL
`secret` text DEFAULT NULL,
FOREIGN KEY (officeHour) REFERENCES officeHour(id)
);
--
@ -38,7 +39,10 @@ CREATE TABLE `officeHour` (
`week` int DEFAULT NULL,
`info` text DEFAULT NULL,
`active` bool DEFAULT NULL,
`duration` int DEFAULT NULL
`duration` int DEFAULT NULL,
FOREIGN KEY (tutor) REFERENCES tutor(id),
FOREIGN KEY (room) REFERENCES room(id),
FOREIGN KEY (course) REFERENCES course(id)
);
--