You are here

function webform_update_7304 in Webform 7.3

Same name and namespace in other branches
  1. 7.4 webform.install \webform_update_7304()

Add field for block feature and redirection setting.

File

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

Code

function webform_update_7304() {
  if (!db_field_exists('webform', 'block')) {
    db_add_field('webform', 'block', array(
      'type' => 'int',
      'size' => 'tiny',
      'not null' => TRUE,
      'default' => 0,
    ));
    db_change_field('webform', 'redirect_url', 'redirect_url', array(
      'type' => 'varchar',
      'length' => 255,
      'default' => '<confirmation>',
    ));
    db_update('webform')
      ->fields(array(
      'redirect_url' => 'confirmation',
    ))
      ->condition('redirect_url', '')
      ->execute();
  }
}