From 055a82e69ba7db7b2740f86698f21f95d58a98cc 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 | 4 ++-- 3 files changed, 17 insertions(+), 3 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..91137ec 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 < 2016052306) { + + $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, 2016052306, 'customcert'); + } + return true; } diff --git a/version.php b/version.php index e1b9c77..8bb6b24 100644 --- a/version.php +++ b/version.php @@ -24,10 +24,10 @@ defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); -$plugin->version = 2016052305; // The current module version (Date: YYYYMMDDXX). +$plugin->version = 2016052306; // The current module version (Date: YYYYMMDDXX). $plugin->requires = 2016052300; // Requires this Moodle version (3.1). $plugin->cron = 0; // Period for cron to check this module (secs). $plugin->component = 'mod_customcert'; $plugin->maturity = MATURITY_STABLE; -$plugin->release = "3.1 release (Build: 2016052305)"; // User-friendly version number. +$plugin->release = "3.1 release (Build: 2016052306)"; // User-friendly version number.