Change field 'element' to character rather than text (#241)

This commit is contained in:
Mark Nelson 2018-12-17 12:36:37 +08:00
parent fe6e5210ab
commit 810bc2d3fd
3 changed files with 13 additions and 2 deletions

View file

@ -75,7 +75,7 @@
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true"/>
<FIELD NAME="pageid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false"/>
<FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="element" TYPE="text" LENGTH="big" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="element" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false"/>
<FIELD NAME="data" TYPE="text" LENGTH="big" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="font" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false"/>
<FIELD NAME="fontsize" TYPE="int" LENGTH="10" NOTNULL="false" SEQUENCE="false"/>

View file

@ -135,5 +135,16 @@ function xmldb_customcert_upgrade($oldversion) {
upgrade_mod_savepoint(true, 2017050506, 'customcert');
}
if ($oldversion < 2017050515) {
$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, 2017050515, 'customcert');
}
return true;
}

View file

@ -24,7 +24,7 @@
defined('MOODLE_INTERNAL') || die('Direct access to this script is forbidden.');
$plugin->version = 2017050514; // The current module version (Date: YYYYMMDDXX).
$plugin->version = 2017050515; // The current module version (Date: YYYYMMDDXX).
$plugin->requires = 2017050500; // Requires this Moodle version (3.3).
$plugin->cron = 0; // Period for cron to check this module (secs).
$plugin->component = 'mod_customcert';