You are here

function webform_update_7417 in Webform 7.4

Change webform_component.name to text to allow for longer labels.

File

./webform.install, line 2036
Webform module install/schema hooks.

Code

function webform_update_7417() {

  // This update function was introduced in 7.x-4.0rc1, which was the first
  // release to require views. While the views requirement was added to the
  // .info file, and while subsequently hook_requirements() added a check for
  // views, it is possible to arrive at this update function via drush updatedb
  // without views enabled.
  $result = NULL;
  if (!module_exists('views')) {
    if (module_enable(array(
      'views',
    ))) {
      $result = t('The Views module was automatically enabled.');
    }
    else {
      throw new DrupalUpdateException(t('UPDATE ERROR: The Views module must be downloaded and enabled before Webform updates can proceed.'));
    }
  }
  db_change_field('webform_component', 'name', 'name', array(
    'type' => 'text',
    'not null' => TRUE,
  ));
  return $result;
}