You are here

function weather_update_6502 in Weather 6.5

Implementation of hook_update_N().

Update some spellings of cities in Romania and Poland. Also insert new cities.

File

./weather.install, line 488
Database installation of weather module.

Code

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

  // Update spellings
  $sql = "UPDATE {weather_icao} SET name='Bucureşti \\'Aurel Vlaicu\\' International Airport'\n    WHERE icao='LRBS'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Bucureşti \\'Henri Coandǎ\\' International Airport'\n    WHERE icao='LROP'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Constanţa' WHERE icao='LRCK'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Timişoara' WHERE icao='LRTR'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Târgu Mureş' WHERE icao='LRTM'";
  $ret[] = update_sql($sql);

  // Insert new cities
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRBC', 'Romania', 'Bacău', 46.521946, 26.910278)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRBM', 'Romania', 'Baia Mare', 47.658389, 23.470022)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRCS', 'Romania', 'Caransebeş Airport, Reşiţa', 45.420000, 22.253333)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRCL', 'Romania', 'Cluj-Napoca', 46.766667, 23.583333)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRCV', 'Romania', 'Craiova', 44.318139, 23.888611)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRIA', 'Romania', 'Iaşi', 47.178492, 27.620631)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LROD', 'Romania', 'Oradea', 47.025278, 21.902500)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRSM', 'Romania', 'Satu Mare', 47.703275, 22.885700)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRSB', 'Romania', 'Sibiu', 45.785597, 24.091342)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LRSV', 'Romania', 'Suceava', 47.687500, 26.354056)";
  $ret[] = update_sql($sql);

  // Insert new city
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('LIRI', 'Italy', 'Salerno', 40.620400, 14.911294)";
  $ret[] = update_sql($sql);

  // Insert new city
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('DNAA', 'Nigeria', 'Abuja', 9.006792, 7.263172)";
  $ret[] = update_sql($sql);

  // Insert new city
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('EPLL', 'Poland', 'Łódź-Lublinek', 51.721944, 19.398056)";
  $ret[] = update_sql($sql);

  // Update spellings
  $sql = "UPDATE {weather_icao} SET name='Gdańsk-Rębiechowo' WHERE icao='EPGD'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Katowice-Pyrzowice' WHERE icao='EPKT'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Kraków-Balice' WHERE icao='EPKK'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Poznań-Ławica' WHERE icao='EPPO'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Rzeszów-Jasionka' WHERE icao='EPRZ'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Szczecin-Goleniów' WHERE icao='EPSC'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Warszawa-Okęcie' WHERE icao='EPWA'";
  $ret[] = update_sql($sql);
  $sql = "UPDATE {weather_icao} SET name='Wrocław-Strachowice' WHERE icao='EPWR'";
  $ret[] = update_sql($sql);

  // Insert new cities
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('HTAR', 'Tanzania', 'Arusha', -3.367794, 36.633333)";
  $ret[] = update_sql($sql);
  $sql = "INSERT INTO {weather_icao} (icao, country, name, latitude, longitude)\n    VALUES ('HTDA', 'Tanzania', 'Dar es Salaam', -6.878111, 39.202625)";
  $ret[] = update_sql($sql);
  return $ret;
}