diff --git a/db/db.update.4.sql b/db/db.update.4.sql index 4f39f8d..280ddf7 100644 --- a/db/db.update.4.sql +++ b/db/db.update.4.sql @@ -7,3 +7,21 @@ CREATE TABLE `judges_timeslots` ( `year` INT NOT NULL , PRIMARY KEY ( `id` ) ); +CREATE TABLE `judges_teams_timeslots_link` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT , + `judges_teams_id` INT UNSIGNED NOT NULL , + `judges_timeslots_id` INT UNSIGNED NOT NULL , + `year` INT UNSIGNED NOT NULL , + PRIMARY KEY ( `id` ) +); +ALTER TABLE judges_teams_timeslots_link ADD UNIQUE (judges_teams_id,judges_timeslots_id,year); +CREATE TABLE `judges_teams_timeslots_projects_link` ( + `id` INT UNSIGNED NOT NULL AUTO_INCREMENT , + `judges_teams_id` INT UNSIGNED NOT NULL , + `judges_timeslots_id` INT UNSIGNED NOT NULL , + `projects_id` INT UNSIGNED NOT NULL , + `year` INT UNSIGNED NOT NULL , + PRIMARY KEY ( `id` ) +); +ALTER TABLE `judges_teams_timeslots_projects_link` ADD UNIQUE (judges_teams_id,judges_timeslots_id,projects_id,year); +ALTER TABLE `projects` CHANGE `projectnumber` `projectnumber` VARCHAR( 16 ) DEFAULT NULL;