Install: Validate database before migrating (#12867)

* Validate database during install
Needed to remove usages of legacy functions in the validation

* Fix output, restore real versions
This commit is contained in:
Tony Murray
2021-05-13 07:18:54 -05:00
committed by GitHub
parent 500b0ac6fa
commit df5096e449
15 changed files with 77 additions and 69 deletions

View File

@@ -279,7 +279,7 @@ function renamehost($id, $new, $source = 'console')
function device_discovery_trigger($id)
{
if (isCli() === false) {
if (App::runningInConsole() === false) {
ignore_user_abort(true);
set_time_limit(0);
}
@@ -296,7 +296,7 @@ function device_discovery_trigger($id)
function delete_device($id)
{
if (isCli() === false) {
if (App::runningInConsole() === false) {
ignore_user_abort(true);
set_time_limit(0);
}
@@ -2017,27 +2017,6 @@ function get_schema_list()
return $files;
}
/**
* Get the current database schema, will return 0 if there is no schema.
*
* @return int
*/
function get_db_schema()
{
try {
$db = \LibreNMS\DB\Eloquent::DB();
if ($db) {
return (int) $db->table('dbSchema')
->orderBy('version', 'DESC')
->value('version');
}
} catch (PDOException $e) {
// return default
}
return 0;
}
/**
* @param $device
* @return int|null