sprechstunden-go/officeHoursMysql.sql

69 lines
1.5 KiB
MySQL
Raw Normal View History

2023-07-16 11:25:34 +00:00
DROP TABLE IF EXISTS `request`;
DROP TABLE IF EXISTS `officeHour`;
DROP TABLE IF EXISTS `room`;
DROP TABLE IF EXISTS `tutor`;
DROP TABLE IF EXISTS `course`;
--
-- Table structure for table `room`
--
CREATE TABLE `room` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`name` text NOT NULL,
`max_occupy` int DEFAULT NULL
);
--
2023-07-16 11:25:34 +00:00
-- Table structure for table `tutor`
--
2023-07-16 11:25:34 +00:00
CREATE TABLE `tutor` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
2023-07-16 11:25:34 +00:00
`name` tinytext DEFAULT NULL,
`email` tinytext DEFAULT NULL
);
--
-- Table structure for table `course`
--
CREATE TABLE `course` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`name` varchar(255) DEFAULT NULL
);
--
-- Table structure for table `officeHour`
--
CREATE TABLE `officeHour` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
`tutor` int DEFAULT NULL,
`day` int DEFAULT NULL,
`hour` int DEFAULT NULL,
`minute` int DEFAULT NULL,
`room` int DEFAULT NULL,
2022-09-27 14:40:47 +00:00
`roomname` text DEFAULT NULL,
`course` int DEFAULT NULL,
`week` int DEFAULT NULL,
`info` text DEFAULT NULL,
`active` bool DEFAULT NULL,
2023-07-16 11:25:34 +00:00
`duration` int DEFAULT NULL,
FOREIGN KEY (tutor) REFERENCES tutor(id),
FOREIGN KEY (room) REFERENCES room(id),
FOREIGN KEY (course) REFERENCES course(id)
);
--
2023-07-16 11:25:34 +00:00
-- Table structure for table `request`
--
2023-07-16 11:25:34 +00:00
CREATE TABLE `request` (
`id` INTEGER PRIMARY KEY AUTO_INCREMENT,
2023-07-16 11:25:34 +00:00
`officeHour` int DEFAULT NULL,
`action` int DEFAULT NULL,
`secret` tinytext DEFAULT NULL,
FOREIGN KEY (officeHour) REFERENCES officeHour(id)
);