diff --git a/resources/db_update_scripts/current.sql b/resources/db_update_scripts/current.sql index be9810d7d9..e69de29bb2 100644 --- a/resources/db_update_scripts/current.sql +++ b/resources/db_update_scripts/current.sql @@ -1,35 +0,0 @@ --- required database changes for the property Match#rejectedBy -ALTER TABLE matchings ADD COLUMN rejectedBy_id bigint(20); -ALTER TABLE matchings ADD CONSTRAINT `FK24A2D416D0C9D7F5` FOREIGN KEY (`rejectedBy_id`) REFERENCES `user` (`id`); - -/* The results running the queries above should look exactly like the hibernate generated table below, this can be tested by -running "show create table matchings;" from the command prompt - -CREATE TABLE IF NOT EXISTS `matchings` ( - `id` bigint(20) NOT NULL AUTO_INCREMENT, - `dateCreated` datetime NOT NULL, - `lastModified` datetime NOT NULL, - `version` int(11) NOT NULL, - `commentForAdmin` varchar(1024) DEFAULT NULL, - `commentForStudent` varchar(1024) DEFAULT NULL, - `points` int(11) NOT NULL, - `status` varchar(255) DEFAULT NULL, - `type` varchar(255) DEFAULT NULL, - `createdBy_id` bigint(20) NOT NULL, - `projectIdea_id` bigint(20) NOT NULL, - `supervisor_id` bigint(20) DEFAULT NULL, - `rejectedBy_id` bigint(20) DEFAULT NULL, - PRIMARY KEY (`id`), - KEY `FK24A2D4169AA5FCB` (`createdBy_id`), - KEY `FK24A2D4164E31D7A1` (`projectIdea_id`), - KEY `FK24A2D416BCA56165` (`supervisor_id`), - KEY `FK24A2D416D0C9D7F5` (`rejectedBy_id`), - CONSTRAINT `FK24A2D416D0C9D7F5` FOREIGN KEY (`rejectedBy_id`) REFERENCES `user` (`id`), - CONSTRAINT `FK24A2D4164E31D7A1` FOREIGN KEY (`projectIdea_id`) REFERENCES `projectIdea` (`id`), - CONSTRAINT `FK24A2D4169AA5FCB` FOREIGN KEY (`createdBy_id`) REFERENCES `user` (`id`), - CONSTRAINT `FK24A2D416BCA56165` FOREIGN KEY (`supervisor_id`) REFERENCES `role` (`id`) -) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1 | -*/ - --- no database changes were required for changing the annotation of ProjectIdea#match from @ManyToOne to @OneToOne - diff --git a/resources/db_update_scripts/update_db_2012-01-23.sql b/resources/db_update_scripts/update_db_2012-01-23.sql new file mode 100644 index 0000000000..be9810d7d9 --- /dev/null +++ b/resources/db_update_scripts/update_db_2012-01-23.sql @@ -0,0 +1,35 @@ +-- required database changes for the property Match#rejectedBy +ALTER TABLE matchings ADD COLUMN rejectedBy_id bigint(20); +ALTER TABLE matchings ADD CONSTRAINT `FK24A2D416D0C9D7F5` FOREIGN KEY (`rejectedBy_id`) REFERENCES `user` (`id`); + +/* The results running the queries above should look exactly like the hibernate generated table below, this can be tested by +running "show create table matchings;" from the command prompt + +CREATE TABLE IF NOT EXISTS `matchings` ( + `id` bigint(20) NOT NULL AUTO_INCREMENT, + `dateCreated` datetime NOT NULL, + `lastModified` datetime NOT NULL, + `version` int(11) NOT NULL, + `commentForAdmin` varchar(1024) DEFAULT NULL, + `commentForStudent` varchar(1024) DEFAULT NULL, + `points` int(11) NOT NULL, + `status` varchar(255) DEFAULT NULL, + `type` varchar(255) DEFAULT NULL, + `createdBy_id` bigint(20) NOT NULL, + `projectIdea_id` bigint(20) NOT NULL, + `supervisor_id` bigint(20) DEFAULT NULL, + `rejectedBy_id` bigint(20) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `FK24A2D4169AA5FCB` (`createdBy_id`), + KEY `FK24A2D4164E31D7A1` (`projectIdea_id`), + KEY `FK24A2D416BCA56165` (`supervisor_id`), + KEY `FK24A2D416D0C9D7F5` (`rejectedBy_id`), + CONSTRAINT `FK24A2D416D0C9D7F5` FOREIGN KEY (`rejectedBy_id`) REFERENCES `user` (`id`), + CONSTRAINT `FK24A2D4164E31D7A1` FOREIGN KEY (`projectIdea_id`) REFERENCES `projectIdea` (`id`), + CONSTRAINT `FK24A2D4169AA5FCB` FOREIGN KEY (`createdBy_id`) REFERENCES `user` (`id`), + CONSTRAINT `FK24A2D416BCA56165` FOREIGN KEY (`supervisor_id`) REFERENCES `role` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=latin1 | +*/ + +-- no database changes were required for changing the annotation of ProjectIdea#match from @ManyToOne to @OneToOne +