sb2g14 / soton_3D_print

3 stars 0 forks source link

Implement Basic Rota #140

Closed GHLasse closed 6 years ago

GHLasse commented 6 years ago

We want to implement the rota which is currently run using Excel on the website.

to get things started, we need the database structure for it.

I suggest the following tables:

GHLasse commented 6 years ago

Update database like this:

CREATE TABLE sessions (id INT NOT NULL AUTO_INCREMENT, start_date DATETIME NOT NULL, end_date DATETIME NOT NULL, dem_required TINYINT NOT NULL, public TINYINT NOT NULL, created_at DATETIME NULL, updated_at DATETIME NULL, PRIMARY KEY ( id ));

CREATE TABLE sessions_staff (id INT NOT NULL AUTO_INCREMENT, sessions_id INT NOT NULL, staff_id INT NOT NULL, PRIMARY KEY ( id ), FOREIGN KEY (sessions_id) REFERENCES sessions(id), FOREIGN KEY (staff_id) REFERENCES staff(id));

CREATE TABLE availabilities (id INT NOT NULL AUTO_INCREMENT, sessions_id INT NOT NULL, staff_id INT NOT NULL, availability ENUM('available','tentative','busy','away'), created_at DATETIME NULL, updated_at DATETIME NULL, PRIMARY KEY ( id ), FOREIGN KEY (sessions_id) REFERENCES sessions(id), FOREIGN KEY (staff_id) REFERENCES staff(id));

CREATE TABLE events (id INT NOT NULL AUTO_INCREMENT, start_date DATETIME NOT NULL, end_date DATETIME NOT NULL, name TINYTEXT NOT NULL, type ENUM('academic','holidays','closure','internal') NOT NULL, created_at DATETIME NULL, updated_at DATETIME NULL, PRIMARY KEY ( id ));
GHLasse commented 6 years ago

I created an SQL file with historic rota data. Most of the workflow is completed now. Last features missing before it can go live:

features that can be added later:

GHLasse commented 6 years ago

Added automatic demonstrator selection - this exceeds the issue, so I will mark it as closed. Please open new issues to address particular problems with the Rota