You are here

function event_update_8 in Event 5.2

Update all_day/end_date columns

File

./event.install, line 337

Code

function event_update_8() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      $ret[] = update_sql('UPDATE {event} SET has_end_date = 0 WHERE event_start = event_end');

      // TODO: Check
      $ret[] = update_sql("UPDATE {event} SET has_time = 0 WHERE EXTRACT(HOUR_SECOND FROM event_start) = 0 AND EXTRACT(HOUR_SECOND FROM event_end) = 235900");
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql('UPDATE {event} SET has_end_date = 0 WHERE event_start = event_end');
      $ret[] = update_sql("UPDATE {event} SET has_time = 0 WHERE EXTRACT(HOUR_SECOND FROM event_start) = 0 AND EXTRACT(HOUR_SECOND FROM event_end) = 235900");
      break;
  }
  return $ret;
}