Add foreign keys to databases.
This commit is contained in:
parent
4ea0471683
commit
9632545d94
2 changed files with 35 additions and 26 deletions
|
@ -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)
|
||||
);
|
||||
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue