mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
feature: Unit test to validate the db schema (#6367)
* Unit test to validate the db schema Changes build-schema.php to just write misc/db_schema.yaml * Only build base if needed Fix 178.sql * Database is always created by init.php add dbSchema test too, should guard against testing against an empty database * feature: support non-standard unix socket (#5724) * Add support for custom MySQL unix-socket * NULL must be lowercase! * Naive edit of html/install.php * fixup * Refactor dbConnect Use it everywhere * $config needs to be global Don't need to set $database_link * small cleanups * Connect to the database for every test. * travis fix for blank line
This commit is contained in:
committed by
Neil Lathwood
parent
b1a414e785
commit
b1483e3d2e
@@ -28,5 +28,9 @@ if (getenv('DBTEST')) {
|
||||
sleep(60);//Sleep for 60 seconds to ensure db work has completed
|
||||
}
|
||||
|
||||
$output = dump_db_schema();
|
||||
echo Symfony\Component\Yaml\Yaml::dump($output, 3, 2);
|
||||
$file = $install_dir . '/misc/db_schema.yaml';
|
||||
$yaml = Symfony\Component\Yaml\Yaml::dump(dump_db_schema(), 3, 2);
|
||||
|
||||
if (file_put_contents($file, $yaml)) {
|
||||
echo "Updated!\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user