You are here

function weather_update_6 in Weather 5.6

Same name and namespace in other branches
  1. 6.5 weather.install \weather_update_6()

File

./weather.install, line 387

Code

function weather_update_6() {
  $ret = array();

  // the table holds all known ICAO codes with further information
  // it's not decoupled, but that's probably not worth the effort.
  // icao: ICAO code of the METAR station
  // country: name of the country
  // name: the METAR station's name
  // latitude: degree of the station
  // longitude: degree of the station
  $sql = "CREATE TABLE {weather_icao} (\n    icao VARCHAR(4) DEFAULT '' NOT NULL,\n    country VARCHAR(255) DEFAULT '' NOT NULL,\n    name VARCHAR(255) DEFAULT '' NOT NULL,\n    latitude DOUBLE PRECISION DEFAULT 0 NOT NULL,\n    longitude DOUBLE PRECISION DEFAULT 0 NOT NULL,\n    PRIMARY KEY (icao)\n  )";

  // ensure the utf8 character set on MySQL (syntax for 4.1 and above)
  if ($GLOBALS['db_type'] == 'mysql' or $GLOBALS['db_type'] == 'mysqli') {
    $sql .= " /*!40100 DEFAULT CHARACTER SET utf8 */";
  }
  $ret[] = update_sql($sql);
  _weather_fill_icao_table();
  return $ret;
}