You are here

function date_update_1 in Date 5

Same name and namespace in other branches
  1. 5.2 date/date.install \date_update_1()

File

./date.install, line 51

Code

function date_update_1() {
  $ret = array();
  if (!db_table_exists('node_field_date_data')) {
    return $ret;
  }
  switch ($GLOBALS['db_type']) {
    case 'pgsql':
      db_add_column($ret, 'node_field_date_data', 'nid', 'integer', array(
        'not null' => TRUE,
        'default' => 0,
      ));
      break;
    case 'mysql':
    case 'mysqli':
      $ret[] = update_sql("ALTER TABLE {node_field_date_data} ADD COLUMN nid int(10) NOT NULL DEFAULT 0");
      break;
  }
  return $ret;
}