You are here

function contact_save_update_7002 in Contact Save 7

Introduce a 'Read' flag for messages and mark all existing messages as having been read.

File

./contact_save.install, line 107
Install, update, and uninstall functions for the contact_save module.

Code

function contact_save_update_7002(&$sandbox) {
  $definition = array(
    'type' => 'int',
    'description' => "Flag for message read status",
    'not null' => TRUE,
    'default' => 0,
  );
  db_add_field('contact_save', 'read', $definition);
  db_update('contact_save')
    ->fields(array(
    '`read`' => REQUEST_TIME,
  ))
    ->execute();
}