Skip to content

Commit

Permalink
MDL-80231 core: cleanup of DB upgrades around ltiservice -> ltixservice
Browse files Browse the repository at this point in the history
Adds a section to update records in the lti_types_config table.
  • Loading branch information
snake committed May 21, 2024
1 parent 180247a commit 49b37d8
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,17 @@ function xmldb_main_upgrade($oldversion) {
}
}

// Move all the service-specific type config for ltiservice_xx plugins to ltixservice_xx.
// Note: need to escape the underscore in the sql_like (:oldprefix2), since that's a wildcard character there.
$sql = "UPDATE {lti_types_config}
SET name = REPLACE(name, :oldprefix, :newprefix)
WHERE ".$DB->sql_like('name', ':oldprefix2');
$DB->execute($sql, [
'oldprefix' => 'ltiservice_',
'newprefix' => 'ltixservice_',
'oldprefix2' => 'ltiservice\_%']
);

// Main savepoint reached.
upgrade_main_savepoint(true, 2024050300.01);
}
Expand Down

0 comments on commit 49b37d8

Please sign in to comment.