| 69 | |
| 70 | |
| 71 | |
| 72 | == Development Change Log == |
| 73 | |
| 74 | === Pre r514 === |
| 75 | |
| 76 | {{{ |
| 77 | #!sql |
| 78 | |
| 79 | ALTER TABLE `events` CHANGE `title` `title` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL DEFAULT '' |
| 80 | |
| 81 | |
| 82 | CREATE TABLE `roles` ( |
| 83 | `id` INT(11) NOT NULL AUTO_INCREMENT , |
| 84 | `name` VARCHAR( 255 ) NOT NULL , |
| 85 | `created` DATETIME NOT NULL , |
| 86 | `modified` DATETIME NOT NULL , |
| 87 | PRIMARY KEY ( `id` ) |
| 88 | ) ENGINE = INNODB; |
| 89 | |
| 90 | CREATE TABLE `ipeer`.`roles_users` ( |
| 91 | `id` INT( 11 ) NOT NULL AUTO_INCREMENT, |
| 92 | `role_id` INT( 11 ) NOT NULL , |
| 93 | `user_id` INT( 11 ) NOT NULL |
| 94 | `created` DATETIME NOT NULL , |
| 95 | `modified` DATETIME NOT NULL |
| 96 | ) ENGINE = INNODB; |
| 97 | |
| 98 | |
| 99 | |
| 100 | ALTER TABLE `users` CHANGE `role` `role` ENUM( 'A', 'I', 'S', 'T' ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT 'S' |
| 101 | |
| 102 | |
| 103 | insert into roles_users (role_id, user_id) select 4, id from users where role LIKE "S"; |
| 104 | insert into roles_users (role_id, user_id) select 3, id from users where role LIKE "I"; |
| 105 | insert into roles_users (role_id, user_id) select 2, id from users where role LIKE "A" AND id !=1; |
| 106 | |
| 107 | ALTER TABLE `groups_members` ADD INDEX ( `group_id` ) |
| 108 | |
| 109 | ALTER TABLE `surveys` CHANGE `name` `name` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL |
| 110 | |
| 111 | # change for question ordering |
| 112 | ALTER TABLE `survey_questions` CHANGE `number` `number` INT( 11 ) NOT NULL DEFAULT '9999' |
| 113 | |
| 114 | # change for auto generating description input textarea |
| 115 | ALTER TABLE `events` CHANGE `description` `description` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | # change rubrics_criteria_comments to associate with rubrics_criterias by criteria id |
| 121 | ALTER TABLE `rubrics_criteria_comments` ADD `criteria_id` INT NOT NULL AFTER `id` |
| 122 | ALTER TABLE `rubrics_criteria_comments` ADD INDEX ( `criteria_id` ) |
| 123 | |
| 124 | UPDATE rubrics_criteria_comments as rcc set criteria_id = (SELECT id from rubrics_criterias as rc WHERE rc.rubric_id = rcc.rubric_id AND rc.criteria_num = rcc.criteria_num) |
| 125 | |
| 126 | ALTER TABLE `rubrics_criteria_comments` ADD FOREIGN KEY ( `criteria_id` ) REFERENCES `ipeer`.`rubrics_criterias` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT ; |
| 127 | |
| 128 | ALTER TABLE `rubrics_criteria_comments` DROP `rubric_id` |
| 129 | ALTER TABLE `rubrics_criteria_comments` DROP `criteria_num` |
| 130 | |
| 131 | # change Criteria comments lom_num to LOM ids |
| 132 | UPDATE rubrics_criteria_comments as rcc, rubrics_criterias as rc, rubrics as r, rubrics_loms as rl set rcc.lom_num=rl.id where rcc.criteria_id = rc.id AND rc.rubric_id = r.id AND rl.rubric_id = r.id AND rl.lom_num = rcc.lom_num |
| 133 | |
| 134 | ALTER TABLE `rubrics_criteria_comments` CHANGE `rubrics_loms_id` `rubrics_loms_id` INT( 11 ) NOT NULL |
| 135 | |
| 136 | ALTER TABLE `rubrics_criteria_comments` ADD INDEX ( `rubrics_loms_id` ) |
| 137 | |
| 138 | ALTER TABLE `rubrics_criteria_comments` ADD FOREIGN KEY ( `rubrics_loms_id` ) REFERENCES `ipeer`.`rubrics_loms` ( |
| 139 | `id` |
| 140 | ) ON DELETE RESTRICT ON UPDATE RESTRICT ; |
| 141 | |
| 142 | # change the default order number to 999 |
| 143 | ALTER TABLE `rubrics_loms` CHANGE `lom_num` `lom_num` INT( 11 ) NOT NULL DEFAULT '999' |
| 144 | ALTER TABLE `rubrics_criterias` CHANGE `criteria_num` `criteria_num` INT( 11 ) NOT NULL DEFAULT '999' |
| 145 | |
| 146 | |
| 147 | # remove total_marks column, using calculated value instead. |
| 148 | ALTER TABLE `rubrics` DROP `total_marks` |
| 149 | |
| 150 | |
| 151 | # change mixeval question description question number to question_id |
| 152 | UPDATE mixevals_question_descs as qd, mixevals_questions as q set qd.question_num = q.id where qd.mixeval_id = q.mixeval_id AND qd.question_num = q.question_num; |
| 153 | |
| 154 | ALTER TABLE `mixevals_question_descs` DROP `mixeval_id`; |
| 155 | |
| 156 | ALTER TABLE `mixevals_question_descs` ADD INDEX ( `question_num` ); |
| 157 | |
| 158 | ALTER TABLE `mixevals_question_descs` CHANGE `question_num` `question_id` INT( 11 ) NOT NULL DEFAULT '0'; |
| 159 | |
| 160 | ALTER TABLE `mixevals_question_descs` ADD FOREIGN KEY ( `question_id` ) REFERENCES `ipeer`.`mixevals_questions` ( |
| 161 | `id` |
| 162 | ) ON DELETE RESTRICT ON UPDATE RESTRICT ; |
| 163 | |
| 164 | |
| 165 | ALTER TABLE `mixevals` DROP `total_marks` |
| 166 | |
| 167 | ALTER TABLE `mixevals_questions` CHANGE `required` `required` BOOLEAN NOT NULL DEFAULT '1'; |
| 168 | |
| 169 | # convert zero_mark columns from enum to boolean |
| 170 | ALTER TABLE `mixevals` CHANGE `zero_mark` `zero_mark` BOOLEAN NOT NULL DEFAULT '0'; |
| 171 | update mixevals set zero_mark=0 where zero_mark=2; |
| 172 | |
| 173 | ALTER TABLE `rubrics` CHANGE `zero_mark` `zero_mark` BOOLEAN NOT NULL DEFAULT '0'; |
| 174 | update rubrics set zero_mark=0 where zero_mark=2; |
| 175 | |
| 176 | |
| 177 | |
| 178 | |
| 179 | |
| 180 | |
| 181 | ALTER TABLE `mixevals` DROP `lickert_question_max` |
| 182 | ALTER TABLE `mixevals` DROP `prefill_question_max` |
| 183 | ALTER TABLE `mixevals` DROP `total_question` |
| 184 | |
| 185 | }}} |