Hi,
I have created one block name 'details'. There are some table in this block which are created in plugin time. Now I need to add one more table name 'block_details_test'. So create a file db->update.php and scripts are given bellow...
?php
function xmldb_block_cmanager_upgrade($oldversion) {
global $CFG, $DB;
$dbman = $DB->get_manager();
$result = true;
//$newrec = new stdClass();
//$newrec->varname = 'selfcat';
//$newrec->value = 'no';
//$DB->insert_record('block_cmanager_config', $newrec, false);
//alter database for required/optional fields
// Conditionally launch rename field timesent
$table = new xmldb_table('block_details_test');
$field = new xmldb_field('reqfield', XMLDB_TYPE_INTEGER, '10', null, null, null, null);
if (!$dbman->field_exists($table, $field)) {
$dbman->add_field($table, $field);
}
upgrade_block_savepoint($result, 22013093002, 'details');
return $result;
}
?>
but when I update the plugin changing the version, it does not create any table and not showing any error. Any one help me to find out where is the problem