From 988af1c457dc50cebbc6088e4a16ec6231dc514d Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Mon, 17 Dec 2018 12:36:37 +0800 Subject: [PATCH] Change field 'element' to character rather than text (#241) --- db/install.xml | 2 +- db/upgrade.php | 11 +++++++++++ version.php | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/db/install.xml b/db/install.xml index 1fbf109..1e2a789 100644 --- a/db/install.xml +++ b/db/install.xml @@ -75,7 +75,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index a666e93..0b213ce 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -135,5 +135,16 @@ function xmldb_customcert_upgrade($oldversion) { upgrade_mod_savepoint(true, 2017050506, 'customcert'); } + if ($oldversion < 2018051705) { + $table = new xmldb_table('customcert_elements'); + $field = new xmldb_field('element', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'name'); + + // Alter the 'element' column to be characters, rather than text. + $dbman->change_field_type($table, $field); + + // Savepoint reached. + upgrade_mod_savepoint(true, 2018051705, 'customcert'); + } + return true; } diff --git a/version.php b/version.php index af35dbc..0e62c91 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); -$plugin->version = 2018051704; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2018051705; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2018051700; // Requires this Moodle version (3.5). $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->component = 'mod_customcert';