#71 Increase customcert_templates 'name' column length

This commit is contained in:
Mark Nelson 2017-01-31 16:54:20 +08:00
parent bda1c48d51
commit 055a82e69b
3 changed files with 17 additions and 3 deletions

View file

@ -25,7 +25,7 @@
<TABLE NAME="customcert_templates" COMMENT="Stores each customcert template"> <TABLE NAME="customcert_templates" COMMENT="Stores each customcert template">
<FIELDS> <FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/> <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="name" TYPE="char" LENGTH="40" NOTNULL="false" SEQUENCE="false"/> <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="References contextid."/> <FIELD NAME="contextid" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="false" COMMENT="References contextid."/>
<FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/> <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>

View file

@ -31,5 +31,19 @@ defined('MOODLE_INTERNAL') || die;
* @return bool always true * @return bool always true
*/ */
function xmldb_customcert_upgrade($oldversion) { 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; return true;
} }

View file

@ -24,10 +24,10 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.'); 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->requires = 2016052300; // Requires this Moodle version (3.1).
$plugin->cron = 0; // Period for cron to check this module (secs). $plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->component = 'mod_customcert'; $plugin->component = 'mod_customcert';
$plugin->maturity = MATURITY_STABLE; $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.