You are here

function event_update_7 in Event 5.2

Add all_day/end_date columns

File

./event.install, line 318

Code

function event_update_7() {
  $ret = array();
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      db_add_column($ret, 'event', 'has_time', 'integer', array(
        'default' => 1,
        'not null' => TRUE,
      ));
      db_add_column($ret, 'event', 'has_end_date', 'integer', array(
        'default' => 1,
        'not null' => TRUE,
      ));
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {event} ADD has_time int NOT NULL default 1");
      $ret[] = update_sql("ALTER TABLE {event} ADD has_end_date int NOT NULL default 1");
      break;
  }
  return $ret;
}