function twitter_update_7515 in Twitter 7.5
Same name and namespace in other branches
- 7.6 twitter.install \twitter_update_7515()
Change Twitter account name field to blob to accommodate utf8mb4 characters.
@todo This schema update is a workaround and should be reverted as soon as Drupal's MySQL implementation properly supports the utf8mb4 character set.
See also
https://www.drupal.org/node/1910376
File
- ./
twitter.install, line 657 - Install, update and uninstall functions for the twitter module.
Code
function twitter_update_7515() {
if (db_field_exists('twitter_account', 'name')) {
$spec = array(
'description' => "The full name of the {twitter_account} user.",
// Using a blob instead of a text type make it possible for MySQL to
// handle extended UTF8 characters, like emoji.
// @see https://www.drupal.org/node/1910376
'type' => 'blob',
// Balance size vs performance. The August 2015 update allows for DMs
// that are 10,000 characters in length, so in theory MySQL's default
// blob length of 16KB should be enough.
'size' => 'normal',
'not null' => TRUE,
);
db_change_field('twitter_account', 'name', 'name', $spec);
}
}