Alter the languages.formula field to increase the length from 128 to 1024 (Belarusian plurals formula was being truncated at 128, which caused errors in export to Transifex)

(DBOINCP-141)
This commit is contained in:
Tristan Olive 2015-05-22 20:58:48 -04:00
parent ce11ffa3ca
commit cc80608da1
1 changed files with 25 additions and 0 deletions

View File

@ -7,6 +7,22 @@
function boinctranslate_install() { function boinctranslate_install() {
// Use schema API to create database table // Use schema API to create database table
//drupal_install_schema('boinctranslate'); //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(); $schema['boinctranslate'] = array();
return $schema; 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;
}