MDL-29620 workshop table id sequence reset after the upgrade

This commit is contained in:
David Mudrak
2011-11-04 13:57:40 +01:00
parent 919e659ba6
commit 562c3f715f
3 changed files with 11 additions and 1 deletions
+8
View File
@@ -308,5 +308,13 @@ function xmldb_workshop_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2011021100, 'workshop');
}
/**
* Fix the eventually corrupted workshop table id sequence
*/
if ($oldversion < 2011030401) {
$dbman->reset_sequence('workshop');
upgrade_mod_savepoint(true, 2011030401, 'workshop');
}
return true;
}
+2
View File
@@ -163,6 +163,8 @@ function workshop_upgrade_module_instances() {
$DB->set_field('workshop_old', 'newid', $new->id, array('id' => $old->id));
}
$rs->close();
$dbman = $DB->get_manager();
$dbman->reset_sequence('workshop');
}
/**
+1 -1
View File
@@ -29,6 +29,6 @@
defined('MOODLE_INTERNAL') || die();
$module->version = 2011030400;
$module->version = 2011030401;
$module->requires = 2011020900; // Requires this Moodle version
//$module->cron = 60;