mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-13 22:54:25 +01:00
Add check for pending database migrations
This commit is contained in:
parent
10527f5dbc
commit
c791b8c6c5
@ -89,6 +89,7 @@ class SystemHealth
|
|||||||
'exchange_rate_api_not_configured' => (bool)self::checkCurrencySanity(),
|
'exchange_rate_api_not_configured' => (bool)self::checkCurrencySanity(),
|
||||||
'api_version' => (string) config('ninja.app_version'),
|
'api_version' => (string) config('ninja.app_version'),
|
||||||
'is_docker' => (bool) config('ninja.is_docker'),
|
'is_docker' => (bool) config('ninja.is_docker'),
|
||||||
|
'pending_migrations' => self::checkPendingMigrations(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,6 +173,17 @@ class SystemHealth
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function checkPendingMigrations()
|
||||||
|
{
|
||||||
|
$run_count = DB::table('migrations')->count();
|
||||||
|
|
||||||
|
$directory = base_path('database/migrations');
|
||||||
|
$iterator = new \FilesystemIterator($directory);
|
||||||
|
$total_count = iterator_count($iterator) - 1;
|
||||||
|
|
||||||
|
return $run_count != $total_count;
|
||||||
|
}
|
||||||
|
|
||||||
public static function getPdfEngine()
|
public static function getPdfEngine()
|
||||||
{
|
{
|
||||||
if (config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja') {
|
if (config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja') {
|
||||||
|
Loading…
Reference in New Issue
Block a user