Skip to content
Browse files

MDL-38344 Calendar: converted name field in event table to text

There is no limitation on length of event name in RFC-2445, so changing type
for name from char to text.
  • Loading branch information...
1 parent ea3f5b5 commit ad7577e14443775c78b98201bbd4f3becc87ba43 @rajeshtaneja rajeshtaneja committed Mar 22, 2013
Showing with 13 additions and 2 deletions.
  1. +1 −1 lib/db/install.xml
  2. +11 −0 lib/db/upgrade.php
  3. +1 −1 version.php
View
2 lib/db/install.xml
@@ -488,7 +488,7 @@
<TABLE NAME="event" COMMENT="For everything with a time associated to it" PREVIOUS="filter_config" NEXT="cache_filters">
<FIELDS>
<FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" SEQUENCE="true" NEXT="name"/>
- <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="description"/>
+ <FIELD NAME="name" TYPE="text" NOTNULL="true" SEQUENCE="false" PREVIOUS="id" NEXT="description"/>
<FIELD NAME="description" TYPE="text" NOTNULL="true" SEQUENCE="false" PREVIOUS="name" NEXT="format"/>
<FIELD NAME="format" TYPE="int" LENGTH="4" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="description" NEXT="courseid"/>
<FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="format" NEXT="groupid"/>
View
11 lib/db/upgrade.php
@@ -1768,5 +1768,16 @@ function xmldb_main_upgrade($oldversion) {
upgrade_main_savepoint(true, 2012120305.01);
}
+ if ($oldversion < 2012120305.08) {
+ // Convert name field in event table to text type as RFC-2445 doesn't have any limitation on it.
+ $table = new xmldb_table('event');
+ $field = new xmldb_field('name', XMLDB_TYPE_TEXT, null, null, XMLDB_NOTNULL, null, null, 'id');
+ if ($dbman->field_exists($table, $field)) {
+ $dbman->change_field_type($table, $field);
+ }
+ // Main savepoint reached.
+ upgrade_main_savepoint(true, 2012120305.08);
+ }
+
return true;
}
View
2 version.php
@@ -29,7 +29,7 @@
defined('MOODLE_INTERNAL') || die();
-$version = 2012120305.07; // 20121203 = branching date YYYYMMDD - do not modify!
+$version = 2012120305.08; // 20121203 = branching date YYYYMMDD - do not modify!
// RR = release increments - 00 in DEV branches
// .XX = incremental changes

0 comments on commit ad7577e

Please sign in to comment.
Something went wrong with that request. Please try again.