You are here

function webform_update_7418 in Webform 7.4

Upgrade the "extra" column in the e-mail table.

Make the column consistent with a new webform installation.

In version 7.x-4.0-rc6 and earlier, the extra field was added with 'not null' FALSE, cause the schema module to report in mismatch. While functionally this causes no problem, this update removes the schema module's warning.

File

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

Code

function webform_update_7418() {

  // While there should never be any NULL values in the extra field, change them
  // to '' to be safe.
  db_update('webform_emails')
    ->fields(array(
    'extra' => '',
  ))
    ->isNull('extra')
    ->execute();

  // Pass a complete field specification to db_change_field for cross-database
  // compatiblity.
  $spec = array(
    'description' => 'A serialized array of additional options for the e-mail configuration, including excluded components and value mapping for the TO and FROM addresses for select lists.',
    'type' => 'text',
    'not null' => TRUE,
  );
  db_change_field('webform_emails', 'extra', 'extra', $spec);
}