Fixed SQLite update procedure.

pull/290/merge
jprochazka 2018-02-28 17:27:50 -05:00
rodzic 677655ea1a
commit c15feeae65
1 zmienionych plików z 2 dodań i 2 usunięć

Wyświetl plik

@ -69,13 +69,13 @@
$columns = $dbh->query("pragma table_info(positions)")->fetchArray(SQLITE3_ASSOC);
$columnExists = FALSE;
foreach($columns as $column ){
if ($column['name'] == 'lastSeen') {
if ($column['name'] == 'positions') {
$columnExists = TRUE;
}
}
// Add the column if it does not exist.
if (!$columnExists) {
$sql = "ALTER TABLE ".$settings::db_prefix."positionss ADD COLUMN aircraft BIGINT";
$sql = "ALTER TABLE ".$settings::db_prefix."positions ADD COLUMN aircraft BIGINT";
$sth = $dbh->prepare($sql);
$sth->execute();
$sth = NULL;