From d1e85a0045473392d78037301cc319c4e415f763 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 19 Oct 2016 15:15:33 +0800 Subject: [PATCH] MDL-53832 enrol_lti: Make DB column names more moodle-ish --- enrol/lti/db/install.xml | 80 ++++++++++++++++++++-------------------- enrol/lti/db/upgrade.php | 80 ++++++++++++++++++++-------------------- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/enrol/lti/db/install.xml b/enrol/lti/db/install.xml index ab08ea85eb0f9..2f22d1c5b24bf 100644 --- a/enrol/lti/db/install.xml +++ b/enrol/lti/db/install.xml @@ -57,21 +57,21 @@ - - + + - - - - + + + + - + - - - + + + @@ -79,107 +79,107 @@ - + - - - + + + - - + +
- - + + - +
- + - +
- - - + + + - - + + - - - + + +
- - - + + + - - + +
- - - + + + - +
- + - +
diff --git a/enrol/lti/db/upgrade.php b/enrol/lti/db/upgrade.php index 5482920881672..3fff0615bd6ff 100644 --- a/enrol/lti/db/upgrade.php +++ b/enrol/lti/db/upgrade.php @@ -49,21 +49,21 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_lti2_consumer. $table->add_field('id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); $table->add_field('name', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, null); - $table->add_field('consumer_key256', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('consumer_key', XMLDB_TYPE_TEXT, null, null, null, null, null); + $table->add_field('consumerkey256', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); + $table->add_field('consumerkey', XMLDB_TYPE_TEXT, null, null, null, null, null); $table->add_field('secret', XMLDB_TYPE_CHAR, '1024', null, XMLDB_NOTNULL, null, null); - $table->add_field('lti_version', XMLDB_TYPE_CHAR, '10', null, null, null, null); - $table->add_field('consumer_name', XMLDB_TYPE_CHAR, '255', null, null, null, null); - $table->add_field('consumer_version', XMLDB_TYPE_CHAR, '255', null, null, null, null); - $table->add_field('consumer_guid', XMLDB_TYPE_CHAR, '1024', null, null, null, null); + $table->add_field('ltiversion', XMLDB_TYPE_CHAR, '10', null, null, null, null); + $table->add_field('consumername', XMLDB_TYPE_CHAR, '255', null, null, null, null); + $table->add_field('consumerversion', XMLDB_TYPE_CHAR, '255', null, null, null, null); + $table->add_field('consumerguid', XMLDB_TYPE_CHAR, '1024', null, null, null, null); $table->add_field('profile', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('tool_proxy', XMLDB_TYPE_TEXT, null, null, null, null, null); + $table->add_field('toolproxy', XMLDB_TYPE_TEXT, null, null, null, null, null); $table->add_field('settings', XMLDB_TYPE_TEXT, null, null, null, null, null); $table->add_field('protected', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null); $table->add_field('enabled', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null); - $table->add_field('enable_from', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('enable_until', XMLDB_TYPE_INTEGER, '10', null, null, null, null); - $table->add_field('last_access', XMLDB_TYPE_INTEGER, '10', null, null, null, null); + $table->add_field('enablefrom', XMLDB_TYPE_INTEGER, '10', null, null, null, null); + $table->add_field('enableuntil', XMLDB_TYPE_INTEGER, '10', null, null, null, null); + $table->add_field('lastaccess', XMLDB_TYPE_INTEGER, '10', null, null, null, null); $table->add_field('created', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); $table->add_field('updated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); @@ -71,7 +71,7 @@ function xmldb_enrol_lti_upgrade($oldversion) { $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); // Adding indexes to table enrol_lti_lti2_consumer. - $table->add_index('consumer_key256_uniq', XMLDB_INDEX_UNIQUE, array('consumer_key256')); + $table->add_index('consumerkey256_uniq', XMLDB_INDEX_UNIQUE, array('consumerkey256')); // Conditionally launch create table for enrol_lti_lti2_consumer. if (!$dbman->table_exists($table)) { @@ -83,16 +83,16 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_lti2_tool_proxy. $table->add_field('id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('tool_proxy_id', XMLDB_TYPE_CHAR, '32', null, XMLDB_NOTNULL, null, null); - $table->add_field('consumer_pk', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); - $table->add_field('tool_proxy', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); + $table->add_field('toolproxykey', XMLDB_TYPE_CHAR, '32', null, XMLDB_NOTNULL, null, null); + $table->add_field('consumerid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); + $table->add_field('toolproxy', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null); $table->add_field('created', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); $table->add_field('updated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); // Adding keys to table enrol_lti_lti2_tool_proxy. $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('tool_proxy_id_uniq', XMLDB_KEY_UNIQUE, array('tool_proxy_id')); - $table->add_key('consumer_pk', XMLDB_KEY_FOREIGN, array('consumer_pk'), 'enrol_lti_lti2_consumer', array('id')); + $table->add_key('toolproxykey_uniq', XMLDB_KEY_UNIQUE, array('toolproxykey')); + $table->add_key('consumerid', XMLDB_KEY_FOREIGN, array('consumerid'), 'enrol_lti_lti2_consumer', array('id')); // Conditionally launch create table for enrol_lti_lti2_tool_proxy. if (!$dbman->table_exists($table)) { @@ -104,15 +104,15 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_lti2_context. $table->add_field('id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('consumer_pk', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); - $table->add_field('lti_context_id', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); + $table->add_field('consumerid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); + $table->add_field('lticontextkey', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); $table->add_field('settings', XMLDB_TYPE_TEXT, null, null, null, null, null); $table->add_field('created', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); $table->add_field('updated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); // Adding keys to table enrol_lti_lti2_context. $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('consumer_pk', XMLDB_KEY_FOREIGN, array('consumer_pk'), 'enrol_lti_lti2_consumer', array('id')); + $table->add_key('consumerid', XMLDB_KEY_FOREIGN, array('consumerid'), 'enrol_lti_lti2_consumer', array('id')); // Conditionally launch create table for enrol_lti_lti2_context. if (!$dbman->table_exists($table)) { @@ -124,13 +124,13 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_lti2_nonce. $table->add_field('id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('consumer_pk', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); + $table->add_field('consumerid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); $table->add_field('value', XMLDB_TYPE_CHAR, '32', null, XMLDB_NOTNULL, null, null); $table->add_field('expires', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); // Adding keys to table enrol_lti_lti2_nonce. $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('consumer_pk', XMLDB_KEY_FOREIGN, array('consumer_pk'), 'enrol_lti_lti2_consumer', array('id')); + $table->add_key('consumerid', XMLDB_KEY_FOREIGN, array('consumerid'), 'enrol_lti_lti2_consumer', array('id')); // Conditionally launch create table for enrol_lti_lti2_nonce. if (!$dbman->table_exists($table)) { @@ -142,21 +142,21 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_lti2_resource_link. $table->add_field('id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('context_pk', XMLDB_TYPE_INTEGER, '11', null, null, null, null); - $table->add_field('consumer_pk', XMLDB_TYPE_INTEGER, '11', null, null, null, null); - $table->add_field('lti_resource_link_id', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); + $table->add_field('contextid', XMLDB_TYPE_INTEGER, '11', null, null, null, null); + $table->add_field('consumerid', XMLDB_TYPE_INTEGER, '11', null, null, null, null); + $table->add_field('ltiresourcelinkkey', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); $table->add_field('settings', XMLDB_TYPE_TEXT, null, null, null, null, null); - $table->add_field('primary_resource_link_pk', XMLDB_TYPE_INTEGER, '11', null, null, null, null); - $table->add_field('share_approved', XMLDB_TYPE_INTEGER, '1', null, null, null, null); + $table->add_field('primaryresourcelinkid', XMLDB_TYPE_INTEGER, '11', null, null, null, null); + $table->add_field('shareapproved', XMLDB_TYPE_INTEGER, '1', null, null, null, null); $table->add_field('created', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); $table->add_field('updated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); // Adding keys to table enrol_lti_lti2_resource_link. $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('context_pk', XMLDB_KEY_FOREIGN, array('context_pk'), 'enrol_lti_lti2_context', array('id')); - $table->add_key('primary_resource_link_pk', XMLDB_KEY_FOREIGN, array('primary_resource_link_pk'), + $table->add_key('contextid', XMLDB_KEY_FOREIGN, array('contextid'), 'enrol_lti_lti2_context', array('id')); + $table->add_key('primaryresourcelinkid', XMLDB_KEY_FOREIGN, array('primaryresourcelinkid'), 'enrol_lti_lti2_resource_link', array('id')); - $table->add_key('consumer_pk', XMLDB_KEY_FOREIGN, array('consumer_pk'), 'enrol_lti_lti2_consumer', array('id')); + $table->add_key('consumerid', XMLDB_KEY_FOREIGN, array('consumerid'), 'enrol_lti_lti2_consumer', array('id')); // Conditionally launch create table for enrol_lti_lti2_resource_link. if (!$dbman->table_exists($table)) { @@ -168,15 +168,15 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_lti2_share_key. $table->add_field('id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('share_key_id', XMLDB_TYPE_CHAR, '32', null, XMLDB_NOTNULL, null, null); - $table->add_field('resource_link_pk', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); - $table->add_field('auto_approve', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null); + $table->add_field('sharekey', XMLDB_TYPE_CHAR, '32', null, XMLDB_NOTNULL, null, null); + $table->add_field('resourcelinkid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); + $table->add_field('autoapprove', XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null); $table->add_field('expires', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); // Adding keys to table enrol_lti_lti2_share_key. $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('share_key_id', XMLDB_KEY_UNIQUE, array('share_key_id')); - $table->add_key('resource_link_pk', XMLDB_KEY_FOREIGN_UNIQUE, array('resource_link_pk'), + $table->add_key('sharekey', XMLDB_KEY_UNIQUE, array('sharekey')); + $table->add_key('resourcelinkid', XMLDB_KEY_FOREIGN_UNIQUE, array('resourcelinkid'), 'enrol_lti_lti2_resource_link', array('id')); // Conditionally launch create table for enrol_lti_lti2_share_key. @@ -189,15 +189,15 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_lti2_user_result. $table->add_field('id', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); - $table->add_field('resource_link_pk', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); - $table->add_field('lti_user_id', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); - $table->add_field('lti_result_sourcedid', XMLDB_TYPE_CHAR, '1024', null, XMLDB_NOTNULL, null, null); + $table->add_field('resourcelinkid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); + $table->add_field('ltiuserkey', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null); + $table->add_field('ltiresultsourcedid', XMLDB_TYPE_CHAR, '1024', null, XMLDB_NOTNULL, null, null); $table->add_field('created', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); $table->add_field('updated', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, null, null); // Adding keys to table enrol_lti_lti2_user_result. $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); - $table->add_key('resource_link_pk', XMLDB_KEY_FOREIGN, array('resource_link_pk'), + $table->add_key('resourcelinkid', XMLDB_KEY_FOREIGN, array('resourcelinkid'), 'enrol_lti_lti2_resource_link', array('id')); // Conditionally launch create table for enrol_lti_lti2_user_result. @@ -211,12 +211,12 @@ function xmldb_enrol_lti_upgrade($oldversion) { // Adding fields to table enrol_lti_tool_consumer_map. $table->add_field('id', XMLDB_TYPE_INTEGER, '10', null, XMLDB_NOTNULL, XMLDB_SEQUENCE, null); $table->add_field('toolid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); - $table->add_field('consumer_pk', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); + $table->add_field('consumerid', XMLDB_TYPE_INTEGER, '11', null, XMLDB_NOTNULL, null, null); // Adding keys to table enrol_lti_tool_consumer_map. $table->add_key('primary', XMLDB_KEY_PRIMARY, array('id')); $table->add_key('toolid', XMLDB_KEY_FOREIGN, array('toolid'), 'enrol_lti_tools', array('id')); - $table->add_key('consumer_pk', XMLDB_KEY_FOREIGN, array('consumer_pk'), 'enrol_lti_lti2_consumer', array('id')); + $table->add_key('consumerid', XMLDB_KEY_FOREIGN, array('consumerid'), 'enrol_lti_lti2_consumer', array('id')); // Conditionally launch create table for enrol_lti_tool_consumer_map. if (!$dbman->table_exists($table)) {