Fixed database upgrade so that forum->scale is created before the

get_scale_menu tries to use it.
This commit is contained in:
moodler 2003-08-16 02:30:23 +00:00
parent 5179875d27
commit 6f4f04df3e
4 changed files with 4 additions and 10 deletions

View File

@ -473,10 +473,11 @@ function main_upgrade($oldversion=0) {
`timemodified` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id)
) TYPE=MyISAM COMMENT='Defines grading scales'");
}
if ($oldversion < 2003081503) {
table_column("forum", "", "scale", "integer", "10", "unsigned", "0", "", "assessed");
get_scales_menu(0); // Just to force the default scale to be created
}

View File

@ -221,6 +221,7 @@ function main_upgrade($oldversion=0) {
}
if ($oldversion < 2003081503) {
table_column("forum", "", "scale", "integer", "10", "unsigned", "0", "", "assessed");
get_scales_menu(0); // Just to force the default scale to be created
}

View File

@ -62,13 +62,8 @@ function forum_upgrade($oldversion) {
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('forum', 'move discussion', 'forum_discussions', 'name')");
}
if ($oldversion < 2003081300) {
table_column("forum", "assessed", "assessed", "integer", "10", "unsigned", "0");
table_column("forum", "", "scale", "integer", "10", "unsigned", "0", "", "assessed");
}
if ($oldversion < 2003081403) {
get_scales_menu(); /// This function will create a new default scale
table_column("forum", "assessed", "assessed", "integer", "10", "unsigned", "0");
}
return true;

View File

@ -10,9 +10,6 @@ function forum_upgrade($oldversion) {
execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('forum', 'move discussion', 'forum_discussions', 'name')");
}
if ($oldversion < 2003081300) {
table_column("forum", "", "scale", "integer", "10", "unsigned", "0", "", "assessed");
}
return true;