mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
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:
@@ -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
|
||||
|
Reference in New Issue
Block a user