You are here

function webform_update_5201 in Webform 5.2

Add a column for email to the webform_component table.

File

./webform.install, line 694

Code

function webform_update_5201() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      $ret[] = update_sql("ALTER TABLE {webform_component} ADD email int(1) UNSIGNED NOT NULL DEFAULT '0'");
      break;
    case 'pgsql':
      $ret[] = update_sql("ALTER TABLE {webform_component} ADD email int NOT NULL DEFAULT '0'");
      break;
  }
  $ret[] = update_sql("UPDATE {webform_component} SET email = 1");
  return $ret;
}