Upgrading table to rename the context->aggregatelevel field which was

really bugging me.   Code should be a little bit more readable now.

Apologies to those with non-core code already using this field.
This commit is contained in:
moodler
2006-09-22 06:19:32 +00:00
parent b988fe5f94
commit aad2ba95d1
12 changed files with 83 additions and 71 deletions
+6
View File
@@ -1884,6 +1884,12 @@ function main_upgrade($oldversion=0) {
}
if ($oldversion < 2006092200) {
execute_sql("ALTER TABLE `{$CFG->prefix}context` DROP INDEX `aggregatelevel-instanceid`;",false);
table_column('context', 'aggregatelevel', 'contextlevel', 'int', '10', 'unsigned', '0', 'not null', '');
execute_sql("ALTER TABLE `{$CFG->prefix}context` ADD UNIQUE INDEX `contextlevel-instanceid` (`contextlevel`, `instanceid`)",false);
}
return $result;
}