Fixing one recently added DB upgrade. Please be careful on STABLE!

Mimic from MOODLE_16_STABLE
This commit is contained in:
stronk7
2006-07-18 16:35:15 +00:00
parent d7444d442f
commit d272c2feb8
2 changed files with 10 additions and 2 deletions
+8
View File
@@ -1992,6 +1992,14 @@ function main_upgrade($oldversion=0) {
table_column("user", "lastIP", "lastip", "varchar", "15", "", "", "not null", "currentlogin");
}
}
// Change in MySQL 5.0.3 concerning how decimals are stored. Mimic from 16_STABLE
// this isn't dangerous because it's a simple type change, but be careful with
// versions and duplicate work in order to provide smooth upgrade paths.
if ($oldversion < 2006071800) {
table_column('grade_letter', 'grade_high', 'grade_high', 'decimal(5,2)', '', '', '100.00', 'not null', '');
table_column('grade_letter', 'grade_low', 'grade_low', 'decimal(5,2)', '', '', '0.00', 'not null', '');
}
return $result;
}
+2 -2
View File
@@ -341,8 +341,8 @@ CREATE TABLE `prefix_grade_letter` (
`id` int(10) unsigned NOT NULL auto_increment,
`courseid` int(10) unsigned NOT NULL default '0',
`letter` varchar(8) NOT NULL default 'NA',
`grade_high` decimal(4,2) NOT NULL default '100.00',
`grade_low` decimal(4,2) NOT NULL default '0.00',
`grade_high` decimal(5,2) NOT NULL default '100.00',
`grade_low` decimal(5,2) NOT NULL default '0.00',
PRIMARY KEY (`id`),
KEY `courseid` (`courseid`)
) TYPE=MyISAM ;