From 30f80d70f7e87e45e7125690e9bf73aa84c5c2e0 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..cd2721e 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 < 2017111306) { + $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, 2017111306, 'customcert'); + } + return true; } diff --git a/version.php b/version.php index 39b8920..26350c1 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); -$plugin->version = 2017111305; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2017111306; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2017111300; // Requires this Moodle version (3.4). $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->component = 'mod_customcert';