Import expense and ledger entries #443 (#588)

* Fix rank importing with PIREP pay #443

* Import ledger information #443

* Uncomment out testing importers

* Import expense log and settings #443

* Formatting
This commit is contained in:
Nabeel S
2020-02-25 14:45:23 -05:00
committed by GitHub
parent 07a75de0bf
commit 14aacdfb75
11 changed files with 251 additions and 6 deletions

View File

@@ -85,6 +85,27 @@ class ImporterDB
return $table;
}
/**
* Does a table exist? Try to get the column information on it.
* The result will be 'false' if that table isn't there
*
* @param $table
*
* @return bool
*/
public function tableExists($table): bool
{
$this->connect();
$sql = 'SHOW COLUMNS FROM '.$this->tableName($table);
$result = $this->conn->query($sql);
if (!$result) {
return false;
}
return true;
}
/**
* Get the names of the columns for a particular table
*