mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Merge pull request #9770 from hillelcoren/v5-develop
Added pending database migrations to the health check
This commit is contained in:
commit
b19fe6c14d
@ -54,7 +54,6 @@ We offer a $30 per year white-label license to remove the Invoice Ninja branding
|
|||||||
git clone --single-branch --branch v5-stable https://github.com/invoiceninja/invoiceninja.git
|
git clone --single-branch --branch v5-stable https://github.com/invoiceninja/invoiceninja.git
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
composer i -o --no-dev
|
composer i -o --no-dev
|
||||||
php artisan key:generate
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Please Note:
|
Please Note:
|
||||||
|
@ -152,7 +152,7 @@ class Handler extends ExceptionHandler
|
|||||||
parent::report($exception);
|
parent::report($exception);
|
||||||
|
|
||||||
if (Ninja::isSelfHost() && $exception instanceof MissingAppKeyException) {
|
if (Ninja::isSelfHost() && $exception instanceof MissingAppKeyException) {
|
||||||
info('To setup the app run "cp .env.example .env" followed by "php artisan key:generate"');
|
info('To setup the app run: cp .env.example .env');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user