Skip to content

Commit

Permalink
MDL-29620 workshop table id sequence reset after the upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
mudrd8mz committed Nov 4, 2011
1 parent 735de1c commit 58c447a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions mod/workshop/db/upgrade.php
Expand Up @@ -311,5 +311,13 @@ function xmldb_workshop_upgrade($oldversion) {
// Moodle v2.1.0 release upgrade line
// Put any upgrade step following this

/**
* Fix the eventually corrupted workshop table id sequence
*/
if ($oldversion < 2011110400) {
$dbman->reset_sequence('workshop');
upgrade_mod_savepoint(true, 2011110400, 'workshop');
}

return true;
}
2 changes: 2 additions & 0 deletions mod/workshop/db/upgradelib.php
Expand Up @@ -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');
}

/**
Expand Down
2 changes: 1 addition & 1 deletion mod/workshop/version.php
Expand Up @@ -29,6 +29,6 @@

defined('MOODLE_INTERNAL') || die();

$module->version = 2011061000;
$module->version = 2011110400;
$module->requires = 2011020900; // Requires this Moodle version
//$module->cron = 60;

0 comments on commit 58c447a

Please sign in to comment.