You are here

function flag_views_bookmark_update_5 in Flag 6.2

Same name and namespace in other branches
  1. 5 includes/flag.views_bookmark.inc \flag_views_bookmark_update_5()
  2. 6 includes/flag.views_bookmark.inc \flag_views_bookmark_update_5()

File

includes/flag.views_bookmark.inc, line 237
Upgrade code to migrate from Views bookmark to Flag module.

Code

function flag_views_bookmark_update_5() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $timestamp = time();
      $ret[] = update_sql("ALTER TABLE {views_bookmark_nodes} ADD timestamp int(11) unsigned NOT NULL default '0'");
      $ret[] = update_sql("UPDATE {views_bookmark_nodes} SET timestamp = {$timestamp} WHERE timestamp = 0");
      break;
  }
  return $ret;
}