Skip to content

Commit

Permalink
Fixed grade_category table definitions to handle change in MySQL vers…
Browse files Browse the repository at this point in the history
…ions 5.0.3 and greater

see http://moodle.org/mod/forum/discuss.php?d=41501 for more details.
  • Loading branch information
jgraham909 committed Mar 16, 2006
1 parent 17eef68 commit 53f6a21
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions lib/db/mysql.php
Expand Up @@ -1729,6 +1729,10 @@ function main_upgrade($oldversion=0) {
set_config('enrol', 'manual'); set_config('enrol', 'manual');
} }
} }

if ($oldversion < 2006031600) {
execute_sql(" ALTER TABLE `{$CFG->prefix}grade_category` CHANGE `weight` `weight` decimal(5,2) default '0.00';");
}


return $result; return $result;
} }
Expand Down
2 changes: 1 addition & 1 deletion lib/db/mysql.sql
Expand Up @@ -291,7 +291,7 @@ CREATE TABLE `prefix_grade_category` (
`drop_x_lowest` int(10) unsigned NOT NULL default '0', `drop_x_lowest` int(10) unsigned NOT NULL default '0',
`bonus_points` int(10) unsigned NOT NULL default '0', `bonus_points` int(10) unsigned NOT NULL default '0',
`hidden` int(10) unsigned NOT NULL default '0', `hidden` int(10) unsigned NOT NULL default '0',
`weight` decimal(4,2) default '0.00', `weight` decimal(5,2) default '0.00',
PRIMARY KEY (`id`), PRIMARY KEY (`id`),
KEY `courseid` (`courseid`) KEY `courseid` (`courseid`)
) TYPE=MyISAM ; ) TYPE=MyISAM ;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Expand Up @@ -6,7 +6,7 @@
// This is compared against the values stored in the database to determine // This is compared against the values stored in the database to determine
// whether upgrades should be performed (see lib/db/*.php) // whether upgrades should be performed (see lib/db/*.php)


$version = 2006031400; // YYYYMMDD = date $version = 2006031600; // YYYYMMDD = date
// XY = increments within a single day // XY = increments within a single day


$release = '1.6 development'; // Human-friendly version name $release = '1.6 development'; // Human-friendly version name
Expand Down

0 comments on commit 53f6a21

Please sign in to comment.