mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-23 09:26:29 -06:00
Create new account and transaction types.
This commit is contained in:
parent
5cfe3cf8a9
commit
03edf6c0a0
@ -81,6 +81,7 @@ class UpgradeDatabase extends Command
|
||||
$this->setTransactionIdentifier();
|
||||
$this->migrateRepetitions();
|
||||
$this->updateAccountCurrencies();
|
||||
$this->createNewTypes();
|
||||
$this->line('Updating currency information..');
|
||||
$this->updateTransferCurrencies();
|
||||
$this->updateOtherCurrencies();
|
||||
@ -289,6 +290,19 @@ class UpgradeDatabase extends Command
|
||||
);
|
||||
}
|
||||
|
||||
private function createNewTypes(): void
|
||||
{
|
||||
// create transaction type "Reconciliation".
|
||||
$type = TransactionType::where('type', TransactionType::RECONCILIATION)->first();
|
||||
if (is_null($type)) {
|
||||
TransactionType::create(['type' => TransactionType::RECONCILIATION]);
|
||||
}
|
||||
$account = AccountType::where('type', AccountType::RECONCILIATION)->first();
|
||||
if (is_null($account)) {
|
||||
AccountType::create(['type' => AccountType::RECONCILIATION]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Move all the journal_meta notes to their note object counter parts.
|
||||
*/
|
||||
@ -300,7 +314,7 @@ class UpgradeDatabase extends Command
|
||||
$journal = $meta->transactionJournal;
|
||||
$note = $journal->notes()->first();
|
||||
if (null === $note) {
|
||||
$note = new Note;
|
||||
$note = new Note();
|
||||
$note->noteable()->associate($journal);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user