You are here

function webform_update_16 in Webform 6.2

Same name and namespace in other branches
  1. 5.2 webform.install \webform_update_16()

Add the submit button text and teaser columns. Remove redirect_post.

File

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

Code

function webform_update_16() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysqli':
    case 'mysql':
      $ret[] = update_sql('ALTER TABLE {webform} DROP redirect_post');
      $ret[] = update_sql('ALTER TABLE {webform} ADD teaser tinyint NOT NULL DEFAULT 0 AFTER confirmation');
      $ret[] = update_sql('ALTER TABLE {webform} ADD submit_text varchar(255) NULL DEFAULT NULL AFTER teaser');
      break;
    case 'pgsql':
      $ret[] = update_sql('ALTER TABLE {webform} DROP redirect_post');
      $ret[] = update_sql('ALTER TABLE {webform} ADD teaser smallint NOT NULL DEFAULT 0');
      $ret[] = update_sql('ALTER TABLE {webform} ADD submit_text varchar(255) NULL DEFAULT NULL');
      break;
  }
  return $ret;
}