You are here

function flag_actions_update_6200 in Flag 6.2

Same name and namespace in other branches
  1. 7.3 flag_actions.install \flag_actions_update_6200()
  2. 7.2 flag_actions.install \flag_actions_update_6200()

Add a "repeat_threshold" value to all existing Flag actions.

File

./flag_actions.install, line 81
Flag actions install file.

Code

function flag_actions_update_6200() {
  $ret = array();

  // Add the new repeat_threshold column.
  if (!db_column_exists('flag_actions', 'repeat_threshold')) {
    $column = array(
      'type' => 'int',
      'size' => 'small',
      'not null' => TRUE,
      'default' => 0,
      'disp-width' => '5',
    );
    db_add_field($ret, 'flag_actions', 'repeat_threshold', $column);
  }

  // Update the normal threshold column to default to 0.
  $column = array(
    'type' => 'int',
    'size' => 'small',
    'not null' => TRUE,
    'default' => 0,
    'disp-width' => '5',
  );
  db_change_field($ret, 'flag_actions', 'threshold', 'threshold', $column);
  return $ret;
}