convert sequence field to text to accomodate very long sequences, see bug 4257

This commit is contained in:
gustav_delius
2006-02-13 23:34:30 +00:00
parent a42f000635
commit b04523d1c4
5 changed files with 13 additions and 4 deletions
+4 -1
View File
@@ -903,7 +903,10 @@ function quiz_upgrade($oldversion) {
table_column('quiz_match_sub', '', 'code', 'int', '10', 'unsigned', '0', 'not null', 'id');
execute_sql("UPDATE {$CFG->prefix}quiz_match_sub SET code = id", false);
}
if ($oldversion < 2006021304) {
// convert sequence field to text to accomodate very long sequences, see bug 4257
table_column('quiz_multianswers', 'sequence', 'sequence', 'text', '', '', '', 'not null', 'question');
}
return true;
}
+1 -1
View File
@@ -259,7 +259,7 @@ CREATE TABLE prefix_quiz_match_sub (
CREATE TABLE prefix_quiz_multianswers (
id int(10) unsigned NOT NULL auto_increment,
question int(10) unsigned NOT NULL default '0',
sequence varchar(255) NOT NULL default '',
sequence text NOT NULL default '',
PRIMARY KEY (id),
KEY question (question)
) TYPE=MyISAM COMMENT='Options for multianswer questions';
+6
View File
@@ -995,6 +995,12 @@ function quiz_upgrade($oldversion) {
table_column('quiz_match_sub', '', 'code', 'int', '10', 'unsigned', '0', 'not null', 'id');
execute_sql("UPDATE {$CFG->prefix}quiz_match_sub SET code = id", false);
}
if ($oldversion < 2006021304) {
// convert sequence field to text to accomodate very long sequences, see bug 4257
table_column('quiz_multianswers', 'sequence', 'sequence', 'text', '', '', '', 'not null', 'question');
}
// Here we need code adding a unique index, see mysql.php
return true;
}
+1 -1
View File
@@ -224,7 +224,7 @@ CREATE INDEX prefix_quiz_match_sub_question_idx ON prefix_quiz_match_sub (questi
CREATE TABLE prefix_quiz_multianswers (
id SERIAL PRIMARY KEY,
question integer NOT NULL default '0',
sequence varchar(255) NOT NULL default ''
sequence text NOT NULL default ''
);
CREATE INDEX prefix_quiz_multianswers_question_idx ON prefix_quiz_multianswers (question);
+1 -1
View File
@@ -5,7 +5,7 @@
// This fragment is called by moodle_needs_upgrading() and /admin/index.php
////////////////////////////////////////////////////////////////////////////////
$module->version = 2006021302; // The (date) version of this module
$module->version = 2006021304; // The (date) version of this module
$module->requires = 2005021600; // Requires this Moodle version
$module->cron = 0; // How often should cron check this module (seconds)?