From ee3bdf7c1828e930a88286ced51df8ed6efad012 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Tue, 31 Jan 2017 16:54:20 +0800 Subject: [PATCH] #71 Increase customcert_templates 'name' column length --- db/install.xml | 2 +- db/upgrade.php | 14 ++++++++++++++ version.php | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/db/install.xml b/db/install.xml index c25af67..09a9964 100644 --- a/db/install.xml +++ b/db/install.xml @@ -25,7 +25,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index 37e7d54..462deea 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -31,5 +31,19 @@ defined('MOODLE_INTERNAL') || die; * @return bool always true */ function xmldb_customcert_upgrade($oldversion) { + global $DB; + + $dbman = $DB->get_manager(); + + if ($oldversion < 2016120503) { + + $table = new xmldb_table('customcert_templates'); + $field = new xmldb_field('name', XMLDB_TYPE_CHAR, '255', null, XMLDB_NOTNULL, null, null, 'id'); + $dbman->change_field_precision($table, $field); + + // Savepoint reached. + upgrade_mod_savepoint(true, 2016120503, 'customcert'); + } + return true; } diff --git a/version.php b/version.php index 7912365..db988eb 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); -$plugin->version = 2016120502; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2016120503; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2016120500; // Requires this Moodle version (3.2). $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->component = 'mod_customcert';