mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Add lookups to check data
This commit is contained in:
parent
77bfabd386
commit
a1cb870a9a
@ -83,9 +83,10 @@ class CheckData extends Command
|
|||||||
$this->checkInvitations();
|
$this->checkInvitations();
|
||||||
$this->checkFailedJobs();
|
$this->checkFailedJobs();
|
||||||
$this->checkAccountData();
|
$this->checkAccountData();
|
||||||
|
$this->checkLookupData();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->logMessage('Done');
|
$this->logMessage('Done: ' . strtoupper($this->isValid ? RESULT_SUCCESS : RESULT_FAILURE));
|
||||||
$errorEmail = env('ERROR_EMAIL');
|
$errorEmail = env('ERROR_EMAIL');
|
||||||
|
|
||||||
$this->info($this->log);
|
$this->info($this->log);
|
||||||
@ -106,6 +107,26 @@ class CheckData extends Command
|
|||||||
$this->log .= $str . "\n";
|
$this->log .= $str . "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function checkLookupData()
|
||||||
|
{
|
||||||
|
$tables = [
|
||||||
|
'account_tokens',
|
||||||
|
'accounts',
|
||||||
|
'companies',
|
||||||
|
'contacts',
|
||||||
|
'invitations',
|
||||||
|
'users',
|
||||||
|
];
|
||||||
|
|
||||||
|
foreach ($tables as $table) {
|
||||||
|
$count = DB::table('lookup_' . $table)->count();
|
||||||
|
if ($count > 0) {
|
||||||
|
$this->logMessage("Lookup table {$table} has {$count} records");
|
||||||
|
$this->isValid = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private function checkUserAccounts()
|
private function checkUserAccounts()
|
||||||
{
|
{
|
||||||
$userAccounts = DB::table('user_accounts')
|
$userAccounts = DB::table('user_accounts')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user