Skip to content

Commit

Permalink
example of the upgrade step to move servcice-specific type config
Browse files Browse the repository at this point in the history
  • Loading branch information
snake committed Dec 7, 2023
1 parent 769c670 commit b44114f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3679,5 +3679,20 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2023100400.03);
}

if ($oldversion < 2023100400.04) {
// Move all the service-specific type config for ltiservice_xx plugins to ltixservice_xx.
foreach (['gradesynchronization', 'memberships', 'toolsettings'] as $name) {
$oldsettingname = 'ltiservice_'.$name;
$newsettingname = 'ltixservice'.$name;
$sql = "UPDATE {lti_types_config};
SET name = :newsettingname
WHERE ". $DB->sql_like('name', $oldsettingname);
$DB->execute($sql, ['newsettingname' => $newsettingname]);
}

// Main savepoint reached.
upgrade_main_savepoint(true, 2023100400.04);
}

return true;
}

0 comments on commit b44114f

Please sign in to comment.