Permalink
Browse files

hotpot: Fixing db upgrade script

Note MySQL upgrade (earlier on by version)


Author: Andrew Walbran <andrew.walbran@catalyst.net.nz>
  • Loading branch information...
1 parent e05e5d1 commit 9861a3997a20f029305f1fb60c717863e4555131 martinlanghoff committed Feb 28, 2007
Showing with 3 additions and 0 deletions.
  1. +3 −0 mod/hotpot/db/update_to_v2.php
View
3 mod/hotpot/db/update_to_v2.php
@@ -61,6 +61,7 @@ function hotpot_update_to_v2_1_21() {
// ensure setting of default values on certain fields
// this was originally done in postgres7.php, but was found to be incompatible with PG7 :-(
$table="hotpot";
+ execute_sql("UPDATE {$CFG->prefix}$table SET studentfeedbackurl = '' WHERE studentfeedbackurl IS NULL");
$ok = $ok && hotpot_db_update_field_type($table, '', 'studentfeedbackurl', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'studentfeedback', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'clickreporting', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
@@ -77,7 +78,9 @@ function hotpot_update_to_v2_1_21() {
$ok = $ok && hotpot_db_update_field_type($table, '', 'score', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'weighting', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'correct', 'VARCHAR', 255, '', 'NOT NULL', '');
+ execute_sql("UPDATE {$CFG->prefix}$table SET wrong = '' WHERE wrong IS NULL");
$ok = $ok && hotpot_db_update_field_type($table, '', 'wrong', 'VARCHAR', 255, '', 'NOT NULL', '');
+ execute_sql("UPDATE {$CFG->prefix}$table SET ignored = '' WHERE ignored IS NULL");
$ok = $ok && hotpot_db_update_field_type($table, '', 'ignored', 'VARCHAR', 255, '', 'NOT NULL', '');
$ok = $ok && hotpot_db_update_field_type($table, '', 'hints', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);
$ok = $ok && hotpot_db_update_field_type($table, '', 'clues', 'INTEGER', 4, 'UNSIGNED', 'NOT NULL', 0);

0 comments on commit 9861a39

Please sign in to comment.