You are here

function votingapi_update_9 in Voting API 6

Same name and namespace in other branches
  1. 5 votingapi.install \votingapi_update_9()
  2. 6.2 votingapi.install \votingapi_update_9()

File

./votingapi.install, line 193

Code

function votingapi_update_9() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {votingapi_cache} ADD COLUMN timestamp int(11) default NULL;");
      break;
    case 'pgsql':
      $ret[] = update_sql("ALTER TABLE {votingapi_cache} ADD COLUMN timestamp int4 default NULL;");
      break;
  }
  $ret[] = update_sql("UPDATE {votingapi_cache} SET timestamp = " . time() . " WHERE timestamp IS NULL;");
  return $ret;
}