Hi there,
I'm upgrading a block I wrote a while back and need to add a new database table. Looking at https://docs.moodle.org/dev/Upgrade_API#Upgrade_API_Cheatsheet the code should be:
function xmldb_block_myblockname_upgrade($oldversion) {
global $DB, $CFG;
$dbman = $DB->get_manager();
if ($oldversion < 2018061303) {
$table = new xmldb_table('my_table_name');
if(!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
upgrade_block_savepoint(true, 2018061303, 'myblockname');
}
}
but this is not working and throwing an error
Unknown DDL library error
Error code: ddlunknownerror
Any clues greatfully received.
Cheers
Dave