diff --git a/lib/db/upgrade.php b/lib/db/upgrade.php index 51a9c54646db7..136fcb85ca456 100644 --- a/lib/db/upgrade.php +++ b/lib/db/upgrade.php @@ -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); }