Hi Davo,
This seems to have cleared up the whole process, and I have used the XMLDB functionality handle the upgrade of the plugin. The problem I face now is that its throwing errors upon triggering the upgrade. Here is the error:
And here is the code from within db/upgrade.php
if ($oldversion < 2017101602) {
// Define main groupwork table block_archivedata_groupwork to be created.
$table1 = new xmldb_table('block_archivedata_groupwork');
// Adding fields to table block_archivedata_groupwork.
$table1->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table1->add_field('groupwork', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');
$table1->add_field('course', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');
$table1->add_field('name', XMLDB_TYPE_CHAR, '255', null, null, null, null);
$table1->add_field('timecreated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table1->add_field('begintime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table1->add_field('archiveid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table1->add_field('endtime', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table1->add_field('timeofarchive', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, '0');
$table1->add_field('archiver', XMLDB_TYPE_INTEGER, '10', null, null, null, '0');
// Adding keys to table block_archivedata_groupwork.
$table1->add_key('primary', XMLDB_KEY_PRIMARY, array('id'));
// Adding indexes to table block_archivedata_groupwork.
$table1->add_index('groupwork', XMLDB_INDEX_NOTUNIQUE, array('groupwork'));
// Conditionally launch create table for block_archivedata_groupwork.
// if (!$dbman->table_exists($table1)) {
$dbman->create_table($table1);
// }
}
Version.php is:
defined('MOODLE_INTERNAL') || die();
$plugin->version = 2017101602;
// $plugin->version = 2017101601;
// $plugin->version = 2015111600; // The current plugin version (Date: YYYYMMDDXX)
$plugin->requires = 2015111000; // Requires this Moodle version
$plugin->component = 'block_archivedata'; // Full name of the plugin (used for diagnostics)
//$plugin->dependencies = array('mod_forum' => 2015111000);