mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Recommend InnoDB engine in validation (#9799)
This commit is contained in:
@ -71,6 +71,7 @@ class Database extends BaseValidation
|
||||
$validator->warn("Your database schema ($current) is newer than expected ($latest). If you just switched to the stable release from the daily release, your database is in between releases and this will be resolved with the next release.");
|
||||
}
|
||||
|
||||
$this->checkMysqlEngine($validator);
|
||||
$this->checkCollation($validator);
|
||||
$this->checkSchema($validator);
|
||||
}
|
||||
@ -104,6 +105,19 @@ class Database extends BaseValidation
|
||||
}
|
||||
}
|
||||
|
||||
private function checkMysqlEngine(Validator $validator)
|
||||
{
|
||||
$db = Config::get('db_name', 'librenms');
|
||||
$query = "SELECT `TABLE_NAME` FROM information_schema.tables WHERE `TABLE_SCHEMA` = '$db' && `ENGINE` != 'InnoDB'";
|
||||
$tables = dbFetchRows($query);
|
||||
if (!empty($tables)) {
|
||||
$validator->result(
|
||||
ValidationResult::warn("Some tables are not using the recommended InnoDB engine, this may cause you issues.")
|
||||
->setList('Tables', $tables)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function checkCollation(Validator $validator)
|
||||
{
|
||||
$db_name = dbFetchCell('SELECT DATABASE()');
|
||||
|
Reference in New Issue
Block a user