Commit eade21a5 authored by Nigel McNie's avatar Nigel McNie
Browse files

Moved part of the MySQL upgrade around, as per a report by Howard Miller that...

Moved part of the MySQL upgrade around, as per a report by Howard Miller that it fixes the 1.0 upgrade for him. The upgrade still works fine for me, so what harm can it do. Fixes #1928.
parent 7eba104e
......@@ -570,6 +570,14 @@ function xmldb_core_upgrade($oldversion=0) {
add_key($typetable, $typekey);
}
// MySQL hasn't dropped the primary key at this point, despite one of the fields disappearing
if (is_mysql()) {
$xmldbtable = new XMLDBTable('usr_activity_preference');
$xmldbkey = new XMLDBKey('primary');
$xmldbkey->setAttributes(XMLDB_KEY_PRIMARY, array('usr'));
drop_key($xmldbtable, $xmldbkey);
}
foreach ($fks as $table => $field) {
$xmldbtable = new XMLDBTable($table);
$xmldbfield = new XMLDBField($field . 'new');
......@@ -588,14 +596,6 @@ function xmldb_core_upgrade($oldversion=0) {
add_key($xmldbtable, $xmldbkey);
}
// MySQL hasn't dropped the primary key at this point, despite one of the fields disappearing
if (is_mysql()) {
$xmldbtable = new XMLDBTable('usr_activity_preference');
$xmldbkey = new XMLDBKey('primary');
$xmldbkey->setAttributes(XMLDB_KEY_PRIMARY, array('usr'));
drop_key($xmldbtable, $xmldbkey);
}
// special case...
$table = new XMLDBTable('usr_activity_preference');
$key = new XMLDBKey('primary');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment