You are here

function comment_notify_update_6004 in Comment Notify 6

Add a "notified" column to {comment_notify} to keep track of whether notifications have already been sent out for a given comment. This prevents new notifications from being sent when a comment is edited.

File

./comment_notify.install, line 271
comment_notify.install.

Code

function comment_notify_update_6004() {
  $ret = array();
  db_add_field($ret, 'comment_notify', 'notified', array(
    'type' => 'int',
    'size' => 'small',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));

  // Set the value in the notified column to 1 for all existing records.
  $ret[] = update_sql('UPDATE {comment_notify} SET notified = 1');
  return $ret;
}