Remove upgrade method.

This commit is contained in:
James Cole 2017-11-30 20:26:56 +01:00
parent c2a129ddb0
commit aca5d8b6e9
No known key found for this signature in database
GPG Key ID: C16961E655E74B5E

View File

@ -79,7 +79,6 @@ class UpgradeDatabase extends Command
public function handle()
{
$this->setTransactionIdentifier();
$this->migrateRepetitions();
$this->updateAccountCurrencies();
$this->createNewTypes();
$this->line('Updating currency information..');
@ -92,28 +91,6 @@ class UpgradeDatabase extends Command
return;
}
/**
* Migrate budget repetitions to new format where the end date is in the budget limit as well,
* making the limit_repetition table obsolete.
*/
public function migrateRepetitions(): void
{
$set = BudgetLimit::whereNull('end_date')->get();
/** @var BudgetLimit $budgetLimit */
foreach ($set as $budgetLimit) {
/** @var LimitRepetition $repetition */
$repetition = $budgetLimit->limitrepetitions()->first();
if (null !== $repetition) {
$budgetLimit->end_date = $repetition->enddate;
$budgetLimit->save();
$this->line(sprintf('Updated budget limit #%d', $budgetLimit->id));
$repetition->delete();
}
}
return;
}
/**
* This method gives all transactions which are part of a split journal (so more than 2) a sort of "order" so they are easier
* to easier to match to their counterpart. When a journal is split, it has two or three transactions: -3, -4 and -5 for example.