Skip to content
Snippets Groups Projects
Commit ebe90937 authored by Justus Dieckmann's avatar Justus Dieckmann
Browse files

Add db-table for interactionlogs

parent 6ebdc134
No related branches found
No related tags found
No related merge requests found
......@@ -111,5 +111,21 @@
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="tool_lifecycle_action_log" COMMENT="Logs for interactions">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="processid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="workflowid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="stepindex" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="time" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false"/>
</FIELDS>
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="processid_fk" TYPE="foreign" FIELDS="processid" REFTABLE="tool_lifecycle_process" REFFIELDS="id"/>
<KEY NAME="workflowid_fk" TYPE="foreign" FIELDS="workflowid" REFTABLE="tool_lifecycle_workflow" REFFIELDS="id"/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
......@@ -327,5 +327,34 @@ function xmldb_tool_lifecycle_upgrade($oldversion) {
upgrade_plugin_savepoint(true, 2019053100, 'tool', 'lifecycle');
}
if ($oldversion < 2019070200) {
// Define table tool_lifecycle_action_log to be created.
$table = new xmldb_table('tool_lifecycle_action_log');
// Adding fields to table tool_lifecycle_action_log.
$table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null);
$table->add_field('processid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('workflowid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('courseid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('stepindex', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('time', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
$table->add_field('userid', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null);
// Adding keys to table tool_lifecycle_action_log.
$table->add_key('primary', XMLDB_KEY_PRIMARY, ['id']);
$table->add_key('processid_fk', XMLDB_KEY_FOREIGN, ['processid'], 'tool_lifecycle_process', ['id']);
$table->add_key('workflowid_fk', XMLDB_KEY_FOREIGN, ['workflowid'], 'tool_lifecycle_workflow', ['id']);
// Conditionally launch create table for tool_lifecycle_action_log.
if (!$dbman->table_exists($table)) {
$dbman->create_table($table);
}
// Lifecycle savepoint reached.
upgrade_plugin_savepoint(true, 2019070200, 'tool', 'lifecycle');
}
return true;
}
\ No newline at end of file
......@@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die;
$plugin->maturity = MATURITY_ALPHA;
$plugin->version = 2019053100;
$plugin->version = 2019070200;
$plugin->component = 'tool_lifecycle';
$plugin->requires = 2017111300; // Require Moodle 3.4 (or above).
$plugin->release = 'v3.6-r1';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment