mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2026-05-04 21:23:36 +00:00
Make sure scripts don't crash when no database present.
This commit is contained in:
@@ -20,6 +20,7 @@ use FireflyIII\Models\TransactionJournal;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Database\QueryException;
|
||||
use Log;
|
||||
use Schema;
|
||||
|
||||
/**
|
||||
* Class UpgradeDatabase
|
||||
@@ -65,6 +66,12 @@ class UpgradeDatabase extends Command
|
||||
*/
|
||||
private function setTransactionIdentifier()
|
||||
{
|
||||
// if table does not exist, return false
|
||||
if (!Schema::hasTable('transaction_journals')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$subQuery = TransactionJournal
|
||||
::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->whereNull('transaction_journals.deleted_at')
|
||||
|
||||
Reference in New Issue
Block a user