| @@ 179-188 (lines=10) @@ | ||
| 176 | $error = ''; |
|
| 177 | // Create table acars_label |
|
| 178 | $error .= create_db::import_file('../db/acars_label.sql'); |
|
| 179 | if ($error == '') { |
|
| 180 | // Update schema_version to 5 |
|
| 181 | $query = "UPDATE `config` SET `value` = '5' WHERE `name` = 'schema_version'"; |
|
| 182 | try { |
|
| 183 | $sth = $Connection->db->prepare($query); |
|
| 184 | $sth->execute(); |
|
| 185 | } catch(PDOException $e) { |
|
| 186 | return "error (update schema_version) : ".$e->getMessage()."\n"; |
|
| 187 | } |
|
| 188 | } |
|
| 189 | return $error; |
|
| 190 | } |
|
| 191 | ||
| @@ 742-753 (lines=12) @@ | ||
| 739 | $Connection = new Connection(); |
|
| 740 | $error = ''; |
|
| 741 | // Add table stats polar |
|
| 742 | if ($globalDBdriver == 'mysql') { |
|
| 743 | //$error .= create_db::import_file('../db/stats_source.sql'); |
|
| 744 | } else { |
|
| 745 | //$error .= create_db::import_file('../db/pgsql/stats_source.sql'); |
|
| 746 | $query = "create index flightaware_id_idx ON spotter_archive USING btree(flightaware_id)"; |
|
| 747 | try { |
|
| 748 | $sth = $Connection->db->prepare($query); |
|
| 749 | $sth->execute(); |
|
| 750 | } catch(PDOException $e) { |
|
| 751 | return "error (create index on spotter_archive) : ".$e->getMessage()."\n"; |
|
| 752 | } |
|
| 753 | } |
|
| 754 | $query = ""; |
|
| 755 | try { |
|
| 756 | $sth = $Connection->db->prepare($query); |
|
| @@ 1102-1110 (lines=9) @@ | ||
| 1099 | global $tmp_dir, $globalDBdriver; |
|
| 1100 | include_once('class.create_db.php'); |
|
| 1101 | $Connection = new Connection(); |
|
| 1102 | if ($Connection->tableExists('airspace')) { |
|
| 1103 | $query = 'DROP TABLE airspace'; |
|
| 1104 | try { |
|
| 1105 | $sth = $Connection->db->prepare($query); |
|
| 1106 | $sth->execute(); |
|
| 1107 | } catch(PDOException $e) { |
|
| 1108 | return "error : ".$e->getMessage(); |
|
| 1109 | } |
|
| 1110 | } |
|
| 1111 | ||
| 1112 | ||
| 1113 | if ($globalDBdriver == 'mysql') update_db::gunzip('../db/airspace.sql.gz',$tmp_dir.'airspace.sql'); |
|
| @@ 1140-1148 (lines=9) @@ | ||
| 1137 | global $tmp_dir, $globalDBdriver; |
|
| 1138 | include_once('class.create_db.php'); |
|
| 1139 | $Connection = new Connection(); |
|
| 1140 | if ($Connection->tableExists('countries')) { |
|
| 1141 | $query = 'DROP TABLE countries'; |
|
| 1142 | try { |
|
| 1143 | $sth = $Connection->db->prepare($query); |
|
| 1144 | $sth->execute(); |
|
| 1145 | } catch(PDOException $e) { |
|
| 1146 | echo "error : ".$e->getMessage(); |
|
| 1147 | } |
|
| 1148 | } |
|
| 1149 | if ($globalDBdriver == 'mysql') { |
|
| 1150 | update_db::gunzip('../db/countries.sql.gz',$tmp_dir.'countries.sql'); |
|
| 1151 | } else { |
|