diff --git a/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.install b/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.install index 5582afb457..f07dda4d5c 100644 --- a/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.install +++ b/drupal/sites/default/boinc/modules/boinctranslate/boinctranslate.install @@ -7,6 +7,22 @@ function boinctranslate_install() { // Use schema API to create database table //drupal_install_schema('boinctranslate'); + + // Alter the formula field in the languages table to increase length from 128 + // to 1024 characters (longer formulas were being truncated) + $ret = array(); + db_change_field( + $ret, + 'languages', + 'formula', + 'formula', + array( + 'type' => 'varchar', + 'length' => 1024, + 'not null' => TRUE, + 'default' => '', + ) + ); } /** @@ -26,3 +42,12 @@ function boinctranslate_schema() { $schema['boinctranslate'] = array(); return $schema; }*/ + +/** + * Implementation of hook_schema_alter(). + */ +function boinctranslate_schema_alter(&$schema) { + // Notify the schema system that the length of languages.formula has been + // increased to 1024 (was 128) + $schema['languages']['fields']['formula']['length'] = 1024; +}