mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-20 16:40:10 +00:00
Remove upgrade method.
This commit is contained in:
@@ -79,7 +79,6 @@ class UpgradeDatabase extends Command
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
$this->setTransactionIdentifier();
|
$this->setTransactionIdentifier();
|
||||||
$this->migrateRepetitions();
|
|
||||||
$this->updateAccountCurrencies();
|
$this->updateAccountCurrencies();
|
||||||
$this->createNewTypes();
|
$this->createNewTypes();
|
||||||
$this->line('Updating currency information..');
|
$this->line('Updating currency information..');
|
||||||
@@ -92,28 +91,6 @@ class UpgradeDatabase extends Command
|
|||||||
return;
|
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
|
* 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.
|
* to easier to match to their counterpart. When a journal is split, it has two or three transactions: -3, -4 and -5 for example.
|
||||||
|
|||||||
Reference in New Issue
Block a user