Skip to content
Snippets Groups Projects

Numerous Database updates

1 file
+ 19
2
Compare changes
  • Side-by-side
  • Inline
-- Created by Vertabelo (http://vertabelo.com)
-- Last modification date: 2018-05-25 12:34:51.216
-- Last modification date: 2018-05-28 07:31:10.158
-- tables
-- Table: Availability
@@ -23,6 +23,8 @@ CREATE TABLE CourseAssignment (
CREATE TABLE CourseDescription (
ce_id int NOT NULL,
description varchar(1023) CHARACTER SET utf8mb4 NOT NULL,
last_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT CourseDescription_pk PRIMARY KEY (ce_id)
);
@@ -36,6 +38,7 @@ CREATE TABLE CourseEdition (
study_year int NOT NULL,
year int NOT NULL,
quarter int NOT NULL,
deleted bool NOT NULL DEFAULT false,
last_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT CourseEdition_pk PRIMARY KEY (id)
@@ -65,6 +68,7 @@ CREATE TABLE Feedback (
-- Table: Lab
CREATE TABLE Lab (
id int NOT NULL AUTO_INCREMENT,
deleted bool NOT NULL DEFAULT false,
last_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT Lab_pk PRIMARY KEY (id)
@@ -165,18 +169,27 @@ CREATE TABLE Schedule (
quarter int NOT NULL,
final bool NOT NULL,
interest bool NOT NULL,
deleted bool NOT NULL DEFAULT false,
last_modified timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
created timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
CONSTRAINT Schedule_pk PRIMARY KEY (id)
);
-- Table: Slot
CREATE TABLE Slot (
id int NOT NULL,
start_time time NOT NULL,
end_time time NOT NULL,
CONSTRAINT Slot_pk PRIMARY KEY (id)
);
-- Table: Timeslot
CREATE TABLE Timeslot (
id int NOT NULL AUTO_INCREMENT,
slot_id int NOT NULL,
year int NOT NULL,
quarter int NOT NULL,
date date NOT NULL,
slot int NOT NULL,
CONSTRAINT Timeslot_pk PRIMARY KEY (id)
);
@@ -311,6 +324,10 @@ ALTER TABLE PersonalPreference ADD CONSTRAINT PersonalPreference_User FOREIGN KE
ALTER TABLE Prerequisites ADD CONSTRAINT Prerequisites_User FOREIGN KEY Prerequisites_User (netid)
REFERENCES User (netid);
-- Reference: Timeslot_Slot (table: Timeslot)
ALTER TABLE Timeslot ADD CONSTRAINT Timeslot_Slot FOREIGN KEY Timeslot_Slot (slot_id)
REFERENCES Slot (id);
-- Reference: User_Role_Role (table: User_Role)
ALTER TABLE User_Role ADD CONSTRAINT User_Role_Role FOREIGN KEY User_Role_Role (role_id)
REFERENCES Role (id);
Loading