You are here

function node_expire_update_6201 in Node expire 8

Same name and namespace in other branches
  1. 6.2 node_expire.install \node_expire_update_6201()
  2. 7.2 node_expire.install \node_expire_update_6201()
  3. 7 node_expire.install \node_expire_update_6201()

Implements hook_update_N().

New field 'lastnotify'. Holds last notified timestamp.

File

./node_expire.install, line 142
Install, uninstall and update the module.

Code

function node_expire_update_6201() {

  // $ret = array();
  if (!db_field_exists('node_expire', 'lastnotify')) {
    db_add_field('node_expire', 'lastnotify', array(
      'type' => 'int',
      'default' => 0,
      'unsigned' => TRUE,
      'not null' => TRUE,
    ));
  }
  db_drop_index('node_expire', 'expire_expired');
  db_add_index('node_expire', 'expire_expired_lastnotify', array(
    'expire',
    'expired',
    'lastnotify',
  ));

  // hook_update_N() no longer returns a $ret array. Instead, return
  // nothing or a translated string indicating the update ran successfully.
  // See http://drupal.org/node/224333#update_sql.  /* $ret */
  return t('TODO Add a descriptive string here to show in the UI.');
}