Skip to content

Firefly III: a personal finances manager

Refactor and renam commands.

James Cole2314ce800484
diff --git a/app/Console/Commands/Integrity/ConvertDatesToUTC.php b/app/Console/Commands/Correction/ConvertsDatesToUTC.php
similarity index 79%
rename from app/Console/Commands/Integrity/ConvertDatesToUTC.php
rename to app/Console/Commands/Correction/ConvertsDatesToUTC.php
index 454ee8a033..d2a59c8666 100644
--- a/app/Console/Commands/Integrity/ConvertDatesToUTC.php
+++ b/app/Console/Commands/Correction/ConvertsDatesToUTC.php
@@ -1,4 +1,23 @@
<?php
+/*
+ * ConvertsDatesToUTC.php
+ * Copyright (c) 2024 [email protected].
+ *
+ * This file is part of Firefly III (https://github.com/firefly-iii).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see https://www.gnu.org/licenses/.
+ */
declare(strict_types=1);
/*
@@ -21,7 +40,7 @@ declare(strict_types=1);
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
-namespace FireflyIII\Console\Commands\Integrity;
+namespace FireflyIII\Console\Commands\Correction;
use Carbon\Carbon;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
@@ -54,6 +73,8 @@ class ConvertDatesToUTC extends Command
*/
public function handle(): int
{
+ $this->friendlyWarning('Please do not use this command.');
+ return 0;
/**
* @var string $model
* @var array $fields
diff --git a/app/Console/Commands/Correction/CorrectDatabase.php b/app/Console/Commands/Correction/CorrectDatabase.php
index d3eadc0ee7..a0bc6607a3 100644
--- a/app/Console/Commands/Correction/CorrectDatabase.php
+++ b/app/Console/Commands/Correction/CorrectDatabase.php
@@ -34,7 +34,7 @@ class CorrectDatabase extends Command
{
use ShowsFriendlyMessages;
- protected $description = 'Will correct the integrity of your database, if necessary.';
+ protected $description = 'Will validate and correct the integrity of your database, if necessary.';
protected $signature = 'firefly-iii:correct-database';
/**
@@ -49,6 +49,14 @@ class CorrectDatabase extends Command
return 1;
}
$commands = [
+
+ // also just in case, some integrity commands:
+ // 'upgrade:restore-oauth-keys',
+ // 'upgrade:add-timezones-to-dates',
+ // 'upgrade:create-group-memberships',
+ // 'upgrade:upgrade-group-information',
+ // 'upgrade:610-currency-preferences',
+ // 'upgrade:620-piggy-banks',
'firefly-iii:fix-piggies',
'firefly-iii:create-link-types',
'firefly-iii:create-access-tokens',
diff --git a/app/Console/Commands/Integrity/UpdateGroupInformation.php b/app/Console/Commands/Correction/CorrectsGroupInformation.php
similarity index 95%
rename from app/Console/Commands/Integrity/UpdateGroupInformation.php
rename to app/Console/Commands/Correction/CorrectsGroupInformation.php
index 3be6c7ee0d..acdb3b4338 100644
--- a/app/Console/Commands/Integrity/UpdateGroupInformation.php
+++ b/app/Console/Commands/Correction/CorrectsGroupInformation.php
@@ -1,8 +1,8 @@
<?php
/*
- * UpdateGroupInformation.php
- * Copyright (c) 2022 [email protected]
+ * CorrectsGroupInformation.php
+ * Copyright (c) 2024 [email protected].
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -17,12 +17,12 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ * along with this program. If not, see https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
-namespace FireflyIII\Console\Commands\Integrity;
+namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Models\Account;
diff --git a/app/Console/Commands/Integrity/AddTimezonesToDates.php b/app/Console/Commands/Correction/CorrectsTimezoneInformation.php
similarity index 82%
rename from app/Console/Commands/Integrity/AddTimezonesToDates.php
rename to app/Console/Commands/Correction/CorrectsTimezoneInformation.php
index cc8be30011..d17451e89a 100644
--- a/app/Console/Commands/Integrity/AddTimezonesToDates.php
+++ b/app/Console/Commands/Correction/CorrectsTimezoneInformation.php
@@ -1,4 +1,23 @@
<?php
+/*
+ * CorrectsTimezoneInformation.php
+ * Copyright (c) 2024 [email protected].
+ *
+ * This file is part of Firefly III (https://github.com/firefly-iii).
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see https://www.gnu.org/licenses/.
+ */
declare(strict_types=1);
/*
@@ -21,7 +40,7 @@ declare(strict_types=1);
* along with this program. If not, see https://www.gnu.org/licenses/.
*/
-namespace FireflyIII\Console\Commands\Integrity;
+namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Models\AccountBalance;
diff --git a/app/Console/Commands/Integrity/CreateGroupMemberships.php b/app/Console/Commands/Correction/CreatesGroupMemberships.php
similarity index 94%
rename from app/Console/Commands/Integrity/CreateGroupMemberships.php
rename to app/Console/Commands/Correction/CreatesGroupMemberships.php
index 0927f1b7cb..02eafb1392 100644
--- a/app/Console/Commands/Integrity/CreateGroupMemberships.php
+++ b/app/Console/Commands/Correction/CreatesGroupMemberships.php
@@ -1,8 +1,8 @@
<?php
/*
- * CreateGroupMemberships.php
- * Copyright (c) 2023 [email protected]
+ * CreatesGroupMemberships.php
+ * Copyright (c) 2024 [email protected].
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -17,12 +17,12 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ * along with this program. If not, see https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
-namespace FireflyIII\Console\Commands\Integrity;
+namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Enums\UserRoleEnum;
diff --git a/app/Console/Commands/Integrity/RestoreOAuthKeys.php b/app/Console/Commands/Correction/RestoresOAuthKeys.php
similarity index 93%
rename from app/Console/Commands/Integrity/RestoreOAuthKeys.php
rename to app/Console/Commands/Correction/RestoresOAuthKeys.php
index b84a7eec14..d216702818 100644
--- a/app/Console/Commands/Integrity/RestoreOAuthKeys.php
+++ b/app/Console/Commands/Correction/RestoresOAuthKeys.php
@@ -1,8 +1,8 @@
<?php
-/**
- * RestoreOAuthKeys.php
- * Copyright (c) 2020 [email protected]
+/*
+ * RestoresOAuthKeys.php
+ * Copyright (c) 2024 [email protected].
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -17,12 +17,12 @@
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ * along with this program. If not, see https://www.gnu.org/licenses/.
*/
declare(strict_types=1);
-namespace FireflyIII\Console\Commands\Integrity;
+namespace FireflyIII\Console\Commands\Correction;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Support\System\OAuthKeys;
diff --git a/app/Console/Commands/Integrity/ReportEmptyObjects.php b/app/Console/Commands/Integrity/ReportsEmptyObjects.php
similarity index 98%
rename from app/Console/Commands/Integrity/ReportEmptyObjects.php
rename to app/Console/Commands/Integrity/ReportsEmptyObjects.php
index 811398d673..882df65b5d 100644
--- a/app/Console/Commands/Integrity/ReportEmptyObjects.php
+++ b/app/Console/Commands/Integrity/ReportsEmptyObjects.php
@@ -34,13 +34,13 @@ use Illuminate\Console\Command;
/**
* Class ReportEmptyObjects
*/
-class ReportEmptyObjects extends Command
+class ReportsEmptyObjects extends Command
{
use ShowsFriendlyMessages;
protected $description = 'Reports on empty database objects.';
- protected $signature = 'firefly-iii:report-empty-objects';
+ protected $signature = 'integrity:empty-objects';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Integrity/ReportIntegrity.php b/app/Console/Commands/Integrity/ReportsIntegrity.php
similarity index 85%
rename from app/Console/Commands/Integrity/ReportIntegrity.php
rename to app/Console/Commands/Integrity/ReportsIntegrity.php
index 3dc698a2d3..59405ecef6 100644
--- a/app/Console/Commands/Integrity/ReportIntegrity.php
+++ b/app/Console/Commands/Integrity/ReportsIntegrity.php
@@ -30,7 +30,7 @@ use Illuminate\Console\Command;
/**
* Class ReportIntegrity
*/
-class ReportIntegrity extends Command
+class ReportsIntegrity extends Command
{
use ShowsFriendlyMessages;
@@ -48,11 +48,9 @@ class ReportIntegrity extends Command
return 1;
}
$commands = [
- 'firefly-iii:add-timezones-to-dates',
- 'firefly-iii:create-group-memberships',
- 'firefly-iii:report-empty-objects',
- 'firefly-iii:report-sum',
- 'firefly-iii:upgrade-group-information',
+ //'firefly-iii:add-timezones-to-dates',
+ 'integrity:empty-objects',
+ 'integrity:total-sums',
];
foreach ($commands as $command) {
$this->friendlyLine(sprintf('Now executing %s', $command));
diff --git a/app/Console/Commands/Integrity/ReportSum.php b/app/Console/Commands/Integrity/ReportsSums.php
similarity index 96%
rename from app/Console/Commands/Integrity/ReportSum.php
rename to app/Console/Commands/Integrity/ReportsSums.php
index d348468aba..82c763093d 100644
--- a/app/Console/Commands/Integrity/ReportSum.php
+++ b/app/Console/Commands/Integrity/ReportsSums.php
@@ -32,12 +32,13 @@ use Illuminate\Console\Command;
/**
* Class ReportSkeleton
*/
-class ReportSum extends Command
+class ReportsSums extends Command
{
use ShowsFriendlyMessages;
protected $description = 'Report on the total sum of transactions. Must be 0.';
- protected $signature = 'firefly-iii:report-sum';
+ protected $signature = 'integrity:total-sums';
+
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/TransactionIdentifier.php b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php
similarity index 98%
rename from app/Console/Commands/Upgrade/TransactionIdentifier.php
rename to app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php
index da2848ef4f..0099b11e5d 100644
--- a/app/Console/Commands/Upgrade/TransactionIdentifier.php
+++ b/app/Console/Commands/Upgrade/AddsTransactionIdentifiers.php
@@ -35,13 +35,13 @@ use Illuminate\Database\QueryException;
/**
* Class TransactionIdentifier
*/
-class TransactionIdentifier extends Command
+class AddsTransactionIdentifiers extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '480_transaction_identifier';
protected $description = 'Fixes transaction identifiers.';
- protected $signature = 'firefly-iii:transaction-identifiers {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-transaction-identifiers {--F|force : Force the execution of this command.}';
private JournalCLIRepositoryInterface $cliRepository;
private int $count;
diff --git a/app/Console/Commands/Upgrade/DecryptDatabase.php b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php
similarity index 97%
rename from app/Console/Commands/Upgrade/DecryptDatabase.php
rename to app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php
index a7ec4f2efa..a8eab8c9a7 100644
--- a/app/Console/Commands/Upgrade/DecryptDatabase.php
+++ b/app/Console/Commands/Upgrade/RemovesDatabaseDecryption.php
@@ -30,15 +30,12 @@ use FireflyIII\Models\Preference;
use Illuminate\Console\Command;
use Illuminate\Contracts\Encryption\DecryptException;
-/**
- * Class DecryptDatabase
- */
-class DecryptDatabase extends Command
+class RemovesDatabaseDecryption extends Command
{
use ShowsFriendlyMessages;
protected $description = 'Decrypts the database.';
- protected $signature = 'firefly-iii:decrypt-all';
+ protected $signature = 'upgrade:480-decrypt-all';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/CorrectAccountBalance.php b/app/Console/Commands/Upgrade/RepairsAccountBalances.php
similarity index 91%
rename from app/Console/Commands/Upgrade/CorrectAccountBalance.php
rename to app/Console/Commands/Upgrade/RepairsAccountBalances.php
index a28ea60737..670b20995c 100644
--- a/app/Console/Commands/Upgrade/CorrectAccountBalance.php
+++ b/app/Console/Commands/Upgrade/RepairsAccountBalances.php
@@ -28,16 +28,13 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Support\Models\AccountBalanceCalculator;
use Illuminate\Console\Command;
-/**
- * Class CorrectionSkeleton
- */
-class CorrectAccountBalance extends Command
+class RepairsAccountBalances extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '610_correct_balances';
protected $description = 'Recalculate all account balance amounts';
- protected $signature = 'firefly-iii:correct-account-balance {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:610-account-balances {--F|force : Force the execution of this command.}';
public function handle(): int
{
diff --git a/app/Console/Commands/Upgrade/FixPostgresSequences.php b/app/Console/Commands/Upgrade/RepairsPostgresSequences.php
similarity index 96%
rename from app/Console/Commands/Upgrade/FixPostgresSequences.php
rename to app/Console/Commands/Upgrade/RepairsPostgresSequences.php
index 01f667f490..7d64be8637 100644
--- a/app/Console/Commands/Upgrade/FixPostgresSequences.php
+++ b/app/Console/Commands/Upgrade/RepairsPostgresSequences.php
@@ -27,16 +27,13 @@ namespace FireflyIII\Console\Commands\Upgrade;
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use Illuminate\Console\Command;
-/**
- * Class FixPostgresSequences
- */
-class FixPostgresSequences extends Command
+class RepairsPostgresSequences extends Command
{
use ShowsFriendlyMessages;
protected $description = 'Fixes issues with PostgreSQL sequences.';
- protected $signature = 'firefly-iii:fix-pgsql-sequences';
+ protected $signature = 'upgrade:600-pgsql-sequences';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php b/app/Console/Commands/Upgrade/UpgradeTransferCurrencies.php
similarity index 99%
rename from app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php
rename to app/Console/Commands/Upgrade/UpgradeTransferCurrencies.php
index ea6e4cb8ca..4057a7f863 100644
--- a/app/Console/Commands/Upgrade/TransferCurrenciesCorrections.php
+++ b/app/Console/Commands/Upgrade/UpgradeTransferCurrencies.php
@@ -35,15 +35,15 @@ use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
use Illuminate\Console\Command;
/**
- * Class TransferCurrenciesCorrections
+ * Class UpgradeTransferCurrencies
*/
-class TransferCurrenciesCorrections extends Command
+class UpgradeTransferCurrencies extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '480_transfer_currencies';
protected $description = 'Updates transfer currency information.';
- protected $signature = 'firefly-iii:transfer-currencies {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-transfer-currencies {--F|force : Force the execution of this command.}';
private array $accountCurrencies;
private AccountRepositoryInterface $accountRepos;
private JournalCLIRepositoryInterface $cliRepos;
diff --git a/app/Console/Commands/Upgrade/AccountCurrencies.php b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php
similarity index 98%
rename from app/Console/Commands/Upgrade/AccountCurrencies.php
rename to app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php
index bc4a0780c0..b50fa0c150 100644
--- a/app/Console/Commands/Upgrade/AccountCurrencies.php
+++ b/app/Console/Commands/Upgrade/UpgradesAccountCurrencies.php
@@ -39,14 +39,14 @@ use Illuminate\Console\Command;
/**
* Class AccountCurrencies
*/
-class AccountCurrencies extends Command
+class UpgradesAccountCurrencies extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '480_account_currencies';
protected $description = 'Give all accounts proper currency info.';
- protected $signature = 'firefly-iii:account-currencies {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-account-currencies {--F|force : Force the execution of this command.}';
private AccountRepositoryInterface $accountRepos;
private int $count;
private UserRepositoryInterface $userRepos;
diff --git a/app/Console/Commands/Upgrade/RenameAccountMeta.php b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php
similarity index 93%
rename from app/Console/Commands/Upgrade/RenameAccountMeta.php
rename to app/Console/Commands/Upgrade/UpgradesAccountMetaData.php
index aba059a38c..8ccbfd63de 100644
--- a/app/Console/Commands/Upgrade/RenameAccountMeta.php
+++ b/app/Console/Commands/Upgrade/UpgradesAccountMetaData.php
@@ -29,10 +29,7 @@ use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\AccountMeta;
use Illuminate\Console\Command;
-/**
- * Class RenameAccountMeta
- */
-class RenameAccountMeta extends Command
+class UpgradesAccountMetaData extends Command
{
use ShowsFriendlyMessages;
@@ -40,7 +37,7 @@ class RenameAccountMeta extends Command
protected $description = 'Rename account meta-data to new format.';
- protected $signature = 'firefly-iii:rename-account-meta {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-account-meta {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/MigrateAttachments.php b/app/Console/Commands/Upgrade/UpgradesAttachments.php
similarity index 95%
rename from app/Console/Commands/Upgrade/MigrateAttachments.php
rename to app/Console/Commands/Upgrade/UpgradesAttachments.php
index cb517059fc..aa2e310733 100644
--- a/app/Console/Commands/Upgrade/MigrateAttachments.php
+++ b/app/Console/Commands/Upgrade/UpgradesAttachments.php
@@ -33,7 +33,7 @@ use Illuminate\Console\Command;
/**
* Class MigrateAttachments
*/
-class MigrateAttachments extends Command
+class UpgradesAttachments extends Command
{
use ShowsFriendlyMessages;
@@ -41,7 +41,7 @@ class MigrateAttachments extends Command
protected $description = 'Migrates attachment meta-data.';
- protected $signature = 'firefly-iii:migrate-attachments {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-attachments {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/MigrateToRules.php b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php
similarity index 98%
rename from app/Console/Commands/Upgrade/MigrateToRules.php
rename to app/Console/Commands/Upgrade/UpgradesBillsToRules.php
index d2fed1a94d..de70c8e761 100644
--- a/app/Console/Commands/Upgrade/MigrateToRules.php
+++ b/app/Console/Commands/Upgrade/UpgradesBillsToRules.php
@@ -36,10 +36,7 @@ use FireflyIII\Repositories\User\UserRepositoryInterface;
use FireflyIII\User;
use Illuminate\Console\Command;
-/**
- * Class MigrateToRules
- */
-class MigrateToRules extends Command
+class UpgradesBillsToRules extends Command
{
use ShowsFriendlyMessages;
@@ -47,7 +44,7 @@ class MigrateToRules extends Command
protected $description = 'Migrate bills to rules.';
- protected $signature = 'firefly-iii:bills-to-rules {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-bills-to-rules {--F|force : Force the execution of this command.}';
private BillRepositoryInterface $billRepository;
private int $count;
private RuleGroupRepositoryInterface $ruleGroupRepository;
diff --git a/app/Console/Commands/Upgrade/AppendBudgetLimitPeriods.php b/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php
similarity index 96%
rename from app/Console/Commands/Upgrade/AppendBudgetLimitPeriods.php
rename to app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php
index 83a0d11548..a43f05682d 100644
--- a/app/Console/Commands/Upgrade/AppendBudgetLimitPeriods.php
+++ b/app/Console/Commands/Upgrade/UpgradesBudgetLimitPeriods.php
@@ -28,10 +28,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Models\BudgetLimit;
use Illuminate\Console\Command;
-/**
- * Class AppendBudgetLimitPeriods
- */
-class AppendBudgetLimitPeriods extends Command
+class UpgradesBudgetLimitPeriods extends Command
{
use ShowsFriendlyMessages;
@@ -39,7 +36,7 @@ class AppendBudgetLimitPeriods extends Command
protected $description = 'Append budget limits with their (estimated) timeframe.';
- protected $signature = 'firefly-iii:budget-limit-periods {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:550-budget-limit-periods {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/BudgetLimitCurrency.php b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php
similarity index 94%
rename from app/Console/Commands/Upgrade/BudgetLimitCurrency.php
rename to app/Console/Commands/Upgrade/UpgradesBudgetLimits.php
index a00cf81e0d..98b4020d78 100644
--- a/app/Console/Commands/Upgrade/BudgetLimitCurrency.php
+++ b/app/Console/Commands/Upgrade/UpgradesBudgetLimits.php
@@ -31,10 +31,7 @@ use FireflyIII\Models\BudgetLimit;
use FireflyIII\User;
use Illuminate\Console\Command;
-/**
- * Class BudgetLimitCurrency
- */
-class BudgetLimitCurrency extends Command
+class UpgradesBudgetLimits extends Command
{
use ShowsFriendlyMessages;
@@ -42,7 +39,7 @@ class BudgetLimitCurrency extends Command
protected $description = 'Give budget limits a currency';
- protected $signature = 'firefly-iii:bl-currency {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-budget-limit-currencies {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/CCLiabilities.php b/app/Console/Commands/Upgrade/UpgradesCreditCardLiabilities.php
similarity index 96%
rename from app/Console/Commands/Upgrade/CCLiabilities.php
rename to app/Console/Commands/Upgrade/UpgradesCreditCardLiabilities.php
index f2211fb59a..33c8acfa90 100644
--- a/app/Console/Commands/Upgrade/CCLiabilities.php
+++ b/app/Console/Commands/Upgrade/UpgradesCreditCardLiabilities.php
@@ -31,16 +31,13 @@ use FireflyIII\Models\AccountType;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
-/**
- * Class CCLiabilities
- */
-class CCLiabilities extends Command
+class UpgradesCreditCardLiabilities extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '480_cc_liabilities';
protected $description = 'Convert old credit card liabilities.';
- protected $signature = 'firefly-iii:cc-liabilities {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-cc-liabilities {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/UpgradeCurrencyPreferences.php b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php
similarity index 95%
rename from app/Console/Commands/Upgrade/UpgradeCurrencyPreferences.php
rename to app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php
index 1e7cd051dc..927b9e1845 100644
--- a/app/Console/Commands/Upgrade/UpgradeCurrencyPreferences.php
+++ b/app/Console/Commands/Upgrade/UpgradesCurrencyPreferences.php
@@ -33,9 +33,9 @@ use Illuminate\Console\Command;
use Illuminate\Support\Collection;
/**
- * Class UpgradeCurrencyPreferences
+ * Class UpgradesCurrencyPreferences
*/
-class UpgradeCurrencyPreferences extends Command
+class UpgradesCurrencyPreferences extends Command
{
use ShowsFriendlyMessages;
@@ -43,7 +43,7 @@ class UpgradeCurrencyPreferences extends Command
protected $description = 'Upgrade user currency preferences';
- protected $signature = 'firefly-iii:upgrade-currency-preferences {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:610-currency-preferences {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/UpgradeDatabase.php b/app/Console/Commands/Upgrade/UpgradesDatabase.php
similarity index 59%
rename from app/Console/Commands/Upgrade/UpgradeDatabase.php
rename to app/Console/Commands/Upgrade/UpgradesDatabase.php
index 3b27f72ebd..10fdde02ea 100644
--- a/app/Console/Commands/Upgrade/UpgradeDatabase.php
+++ b/app/Console/Commands/Upgrade/UpgradesDatabase.php
@@ -29,10 +29,7 @@ set_time_limit(0);
use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use Illuminate\Console\Command;
-/**
- * Class UpgradeDatabase
- */
-class UpgradeDatabase extends Command
+class UpgradesDatabase extends Command
{
use ShowsFriendlyMessages;
@@ -46,33 +43,26 @@ class UpgradeDatabase extends Command
{
$this->callInitialCommands();
$commands = [
- 'firefly-iii:transaction-identifiers',
- 'firefly-iii:migrate-to-groups',
- 'firefly-iii:account-currencies',
- 'firefly-iii:transfer-currencies',
- 'firefly-iii:other-currencies',
- 'firefly-iii:migrate-notes',
- 'firefly-iii:migrate-attachments',
- 'firefly-iii:bills-to-rules',
- 'firefly-iii:bl-currency',
- 'firefly-iii:cc-liabilities',
- 'firefly-iii:back-to-journals',
- 'firefly-iii:rename-account-meta',
- 'firefly-iii:migrate-recurrence-meta',
- 'firefly-iii:migrate-tag-locations',
- 'firefly-iii:migrate-recurrence-type',
- 'firefly-iii:upgrade-liabilities',
- 'firefly-iii:liabilities-600',
- 'firefly-iii:budget-limit-periods',
- 'firefly-iii:migrate-rule-actions',
- 'firefly-iii:restore-oauth-keys',
- 'firefly-iii:correct-account-balance',
- // also just in case, some integrity commands:
- 'firefly-iii:add-timezones-to-dates',
- 'firefly-iii:create-group-memberships',
- 'firefly-iii:upgrade-group-information',
- 'firefly-iii:upgrade-currency-preferences',
- 'firefly-iii:upgrade-multi-piggies',
+ 'upgrade:480-transaction-identifiers',
+ 'upgrade:480-migrate-to-groups',
+ 'upgrade:480-account-currencies',
+ 'upgrade:480-transfer-currencies',
+ 'upgrade:480-currency-information',
+ 'upgrade:480-notes',
+ 'upgrade:480-attachments',
+ 'upgrade:480-bills-to-rules',
+ 'upgrade:480-budget-limit-currencies',
+ 'upgrade:480-cc-liabilities',
+ 'upgrade:480-journal-meta-data',
+ 'upgrade:480-account-meta',
+ 'upgrade:481-recurrence-meta',
+ 'upgrade:500-tag-locations',
+ 'upgrade:550-recurrence-type',
+ 'upgrade:560-liabilities',
+ 'upgrade:600-liabilities',
+ 'upgrade:550-budget-limit-periods',
+ 'upgrade:600-rule-actions',
+ 'upgrade:610-account-balance',
'firefly-iii:correct-database',
];
$args = [];
@@ -94,7 +84,7 @@ class UpgradeDatabase extends Command
private function callInitialCommands(): void
{
$this->call('migrate', ['--seed' => true, '--force' => true, '--no-interaction' => true]);
- $this->call('firefly-iii:fix-pgsql-sequences');
- $this->call('firefly-iii:decrypt-all');
+ $this->call('upgrade:600-pgsql-sequences');
+ $this->call('upgrade:480-decrypt-all');
}
}
diff --git a/app/Console/Commands/Upgrade/BackToJournals.php b/app/Console/Commands/Upgrade/UpgradesJournalMetaData.php
similarity index 96%
rename from app/Console/Commands/Upgrade/BackToJournals.php
rename to app/Console/Commands/Upgrade/UpgradesJournalMetaData.php
index 31f72f2c74..325de12feb 100644
--- a/app/Console/Commands/Upgrade/BackToJournals.php
+++ b/app/Console/Commands/Upgrade/UpgradesJournalMetaData.php
@@ -32,10 +32,7 @@ use FireflyIII\Models\TransactionJournal;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
-/**
- * Class BackToJournals
- */
-class BackToJournals extends Command
+class UpgradesJournalMetaData extends Command
{
use ShowsFriendlyMessages;
@@ -43,7 +40,7 @@ class BackToJournals extends Command
protected $description = 'Move meta data back to journals, not individual transactions.';
- protected $signature = 'firefly-iii:back-to-journals {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-journal-meta-data {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
@@ -71,7 +68,7 @@ class BackToJournals extends Command
private function isMigrated(): bool
{
- $configVar = app('fireflyconfig')->get(MigrateToGroups::CONFIG_NAME, false);
+ $configVar = app('fireflyconfig')->get(self::CONFIG_NAME, false);
return (bool) $configVar->data;
}
diff --git a/app/Console/Commands/Upgrade/MigrateJournalNotes.php b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php
similarity index 93%
rename from app/Console/Commands/Upgrade/MigrateJournalNotes.php
rename to app/Console/Commands/Upgrade/UpgradesJournalNotes.php
index 2434ba4d10..e638b4144b 100644
--- a/app/Console/Commands/Upgrade/MigrateJournalNotes.php
+++ b/app/Console/Commands/Upgrade/UpgradesJournalNotes.php
@@ -29,10 +29,7 @@ use FireflyIII\Models\Note;
use FireflyIII\Models\TransactionJournalMeta;
use Illuminate\Console\Command;
-/**
- * Class MigrateJournalNotes
- */
-class MigrateJournalNotes extends Command
+class UpgradesJournalNotes extends Command
{
use ShowsFriendlyMessages;
@@ -40,7 +37,7 @@ class MigrateJournalNotes extends Command
protected $description = 'Migrate notes for transaction journals.';
- protected $signature = 'firefly-iii:migrate-notes {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-notes {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/UpgradeLiabilities.php b/app/Console/Commands/Upgrade/UpgradesLiabilities.php
similarity index 96%
rename from app/Console/Commands/Upgrade/UpgradeLiabilities.php
rename to app/Console/Commands/Upgrade/UpgradesLiabilities.php
index 66902b171c..c75ccc6a99 100644
--- a/app/Console/Commands/Upgrade/UpgradeLiabilities.php
+++ b/app/Console/Commands/Upgrade/UpgradesLiabilities.php
@@ -34,16 +34,13 @@ use FireflyIII\Services\Internal\Support\CreditRecalculateService;
use FireflyIII\User;
use Illuminate\Console\Command;
-/**
- * Class UpgradeLiabilities
- */
-class UpgradeLiabilities extends Command
+class UpgradesLiabilities extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '560_upgrade_liabilities';
protected $description = 'Upgrade liabilities to new 5.6.0 structure.';
- protected $signature = 'firefly-iii:upgrade-liabilities {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:560-liabilities {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php
similarity index 85%
rename from app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php
rename to app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php
index 1422e77363..a28fb86324 100644
--- a/app/Console/Commands/Upgrade/UpgradeLiabilitiesEight.php
+++ b/app/Console/Commands/Upgrade/UpgradesLiabilitiesEight.php
@@ -35,16 +35,13 @@ use FireflyIII\Services\Internal\Support\CreditRecalculateService;
use FireflyIII\User;
use Illuminate\Console\Command;
-/**
- * Class UpgradeLiabilitiesEight
- */
-class UpgradeLiabilitiesEight extends Command
+class UpgradesLiabilitiesEight extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '600_upgrade_liabilities';
protected $description = 'Upgrade liabilities to new 6.0.0 structure.';
- protected $signature = 'firefly-iii:liabilities-600 {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:600-liabilities {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
@@ -201,32 +198,9 @@ class UpgradeLiabilitiesEight extends Command
/** @var TransactionJournal $journal */
foreach ($journals as $journal) {
- // $delete = false;
- // /** @var Transaction $source */
- // $source = $journal->transactions()->where('amount', '<', 0)->first();
- // /** @var Transaction $dest */
- // $dest = $journal->transactions()->where('amount', '>', 0)->first();
-
- /**
- * // if source is this liability and destination is expense, remove transaction.
- * // if source is revenue and destination is liability, remove transaction.
- * if ($source->account_id === $account->id && $dest->account->accountType->type === AccountType::EXPENSE) {
- * $delete = true;
- * }
- * if ($dest->account_id === $account->id && $source->account->accountType->type === AccountType::REVENUE) {
- * $delete = true;
- * }
- *
- * // overruled. No transaction will be deleted, ever.
- * // code is kept in place, so I can revisit my reasoning.
- * $delete = false;
- */
-
- // if ($delete) {
$service = app(TransactionGroupDestroyService::class);
$service->destroy($journal->transactionGroup);
++$count;
- // }
}
return $count;
diff --git a/app/Console/Commands/Upgrade/UpgradeMultiPiggyBanks.php b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php
similarity index 93%
rename from app/Console/Commands/Upgrade/UpgradeMultiPiggyBanks.php
rename to app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php
index 6914bc0919..9284ca913a 100644
--- a/app/Console/Commands/Upgrade/UpgradeMultiPiggyBanks.php
+++ b/app/Console/Commands/Upgrade/UpgradesMultiPiggyBanks.php
@@ -30,15 +30,15 @@ use FireflyIII\Repositories\PiggyBank\PiggyBankRepositoryInterface;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Log;
-class UpgradeMultiPiggyBanks extends Command
+class UpgradesMultiPiggyBanks extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '620_make_multi_piggies';
- protected $description = 'Upgrade piggybanks so they can use multiple accounts.';
+ protected $description = 'Upgrade piggy banks so they can use multiple accounts.';
- protected $signature = 'firefly-iii:upgrade-multi-piggies {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:620-piggy-banks {--F|force : Force the execution of this command.}';
private AccountRepositoryInterface $accountRepository;
private PiggyBankRepositoryInterface $repository;
diff --git a/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php
similarity index 95%
rename from app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
rename to app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php
index 5b79a96f3c..e2e04cf3cd 100644
--- a/app/Console/Commands/Upgrade/MigrateRecurrenceMeta.php
+++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceMetaData.php
@@ -33,7 +33,7 @@ use Illuminate\Console\Command;
/**
* Class MigrateRecurrenceMeta
*/
-class MigrateRecurrenceMeta extends Command
+class UpgradesRecurrenceMetaData extends Command
{
use ShowsFriendlyMessages;
@@ -41,7 +41,7 @@ class MigrateRecurrenceMeta extends Command
protected $description = 'Migrate recurrence meta data';
- protected $signature = 'firefly-iii:migrate-recurrence-meta {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:481-recurrence-meta {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/MigrateRecurrenceType.php b/app/Console/Commands/Upgrade/UpgradesRecurrenceType.php
similarity index 91%
rename from app/Console/Commands/Upgrade/MigrateRecurrenceType.php
rename to app/Console/Commands/Upgrade/UpgradesRecurrenceType.php
index d8cf398141..802e303f94 100644
--- a/app/Console/Commands/Upgrade/MigrateRecurrenceType.php
+++ b/app/Console/Commands/Upgrade/UpgradesRecurrenceType.php
@@ -30,7 +30,7 @@ use Illuminate\Console\Command;
/**
* Class MigrateRecurrenceType
*/
-class MigrateRecurrenceType extends Command
+class UpgradesRecurrenceType extends Command
{
use ShowsFriendlyMessages;
@@ -38,7 +38,7 @@ class MigrateRecurrenceType extends Command
protected $description = 'Migrate transaction type of recurring transaction.';
- protected $signature = 'firefly-iii:migrate-recurrence-type {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:550-recurrence-type {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/MigrateRuleActions.php b/app/Console/Commands/Upgrade/UpgradesRuleActions.php
similarity index 97%
rename from app/Console/Commands/Upgrade/MigrateRuleActions.php
rename to app/Console/Commands/Upgrade/UpgradesRuleActions.php
index f0c825b40f..c6341238ae 100644
--- a/app/Console/Commands/Upgrade/MigrateRuleActions.php
+++ b/app/Console/Commands/Upgrade/UpgradesRuleActions.php
@@ -27,7 +27,7 @@ use FireflyIII\Console\Commands\ShowsFriendlyMessages;
use FireflyIII\Models\RuleAction;
use Illuminate\Console\Command;
-class MigrateRuleActions extends Command
+class UpgradesRuleActions extends Command
{
use ShowsFriendlyMessages;
@@ -35,7 +35,7 @@ class MigrateRuleActions extends Command
protected $description = 'Migrate rule actions away from expression engine';
- protected $signature = 'firefly-iii:migrate-rule-actions {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:600-rule-actions {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/MigrateTagLocations.php b/app/Console/Commands/Upgrade/UpgradesTagLocations.php
similarity index 94%
rename from app/Console/Commands/Upgrade/MigrateTagLocations.php
rename to app/Console/Commands/Upgrade/UpgradesTagLocations.php
index 7284622067..d0a297c20c 100644
--- a/app/Console/Commands/Upgrade/MigrateTagLocations.php
+++ b/app/Console/Commands/Upgrade/UpgradesTagLocations.php
@@ -32,7 +32,7 @@ use Illuminate\Console\Command;
/**
* Class MigrateTagLocations
*/
-class MigrateTagLocations extends Command
+class UpgradesTagLocations extends Command
{
use ShowsFriendlyMessages;
@@ -40,7 +40,7 @@ class MigrateTagLocations extends Command
protected $description = 'Migrate tag locations.';
- protected $signature = 'firefly-iii:migrate-tag-locations {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:500-tag-locations {--F|force : Force the execution of this command.}';
/**
* Execute the console command.
diff --git a/app/Console/Commands/Upgrade/MigrateToGroups.php b/app/Console/Commands/Upgrade/UpgradesToGroups.php
similarity index 98%
rename from app/Console/Commands/Upgrade/MigrateToGroups.php
rename to app/Console/Commands/Upgrade/UpgradesToGroups.php
index c9b475217a..c0c7cf3e10 100644
--- a/app/Console/Commands/Upgrade/MigrateToGroups.php
+++ b/app/Console/Commands/Upgrade/UpgradesToGroups.php
@@ -36,20 +36,13 @@ use FireflyIII\Services\Internal\Destroy\JournalDestroyService;
use Illuminate\Console\Command;
use Illuminate\Support\Collection;
-/**
- * This command will take split transactions and migrate them to "transaction groups".
- *
- * It will only run once, but can be forced to run again.
- *
- * Class MigrateToGroups
- */
-class MigrateToGroups extends Command
+class UpgradesToGroups extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '480_migrated_to_groups';
protected $description = 'Migrates a pre-4.7.8 transaction structure to the 4.7.8+ transaction structure.';
- protected $signature = 'firefly-iii:migrate-to-groups {--F|force : Force the migration, even if it fired before.}';
+ protected $signature = 'upgrade:480-migrate-to-groups {--F|force : Force the migration, even if it fired before.}';
private JournalCLIRepositoryInterface $cliRepository;
private int $count;
private TransactionGroupFactory $groupFactory;
diff --git a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php
similarity index 97%
rename from app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
rename to app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php
index 0f4a601054..4e7398915f 100644
--- a/app/Console/Commands/Upgrade/OtherCurrenciesCorrections.php
+++ b/app/Console/Commands/Upgrade/UpgradesVariousCurrencyInformation.php
@@ -36,16 +36,14 @@ use FireflyIII\Repositories\Journal\JournalCLIRepositoryInterface;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Console\Command;
-/**
- * Class OtherCurrenciesCorrections
- */
-class OtherCurrenciesCorrections extends Command
+
+class UpgradesVariousCurrencyInformation extends Command
{
use ShowsFriendlyMessages;
public const string CONFIG_NAME = '480_other_currencies';
protected $description = 'Update all journal currency information.';
- protected $signature = 'firefly-iii:other-currencies {--F|force : Force the execution of this command.}';
+ protected $signature = 'upgrade:480-currency-information {--F|force : Force the execution of this command.}';
private array $accountCurrencies;
private AccountRepositoryInterface $accountRepos;
private JournalCLIRepositoryInterface $cliRepos;
diff --git a/app/Support/Authentication/RemoteUserProvider.php b/app/Support/Authentication/RemoteUserProvider.php
index a218dd5bfe..548b6bab15 100644
--- a/app/Support/Authentication/RemoteUserProvider.php
+++ b/app/Support/Authentication/RemoteUserProvider.php
@@ -24,7 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Support\Authentication;
-use FireflyIII\Console\Commands\Integrity\CreateGroupMemberships;
+use FireflyIII\Console\Commands\Correction\CreateGroupMemberships;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Role;
use FireflyIII\User;
diff --git a/resources/lang/en_US/firefly.php b/resources/lang/en_US/firefly.php
index 313229c2d8..403811e6eb 100644
--- a/resources/lang/en_US/firefly.php
+++ b/resources/lang/en_US/firefly.php
@@ -1766,6 +1766,7 @@ return [
'updated_currency' => 'Currency :name updated',
'ask_site_owner' => 'Please ask :owner to add, remove or edit currencies.',
'currencies_intro' => 'Firefly III supports various currencies which you can set and enable here.',
+ 'currencies_switch_default' => 'If you have a large database, switching from one default currency to another may take a moment.',
'make_default_currency' => 'Make default',
'default_currency' => 'default',
'currency_is_disabled' => 'Disabled',
diff --git a/resources/views/currencies/index.twig b/resources/views/currencies/index.twig
index 93b30071d9..9da52a312b 100644
--- a/resources/views/currencies/index.twig
+++ b/resources/views/currencies/index.twig
@@ -13,11 +13,10 @@
<a class="btn btn-success pull-right" href="{{ route('currencies.create') }}">{{ 'create_currency'|_ }}</a>
</div>
<div class="box-body">
- <p class="text-info">
+ <p>
{{ 'currencies_intro'|_ }}
- </p>
- <p class="text-info">
{{ 'currencies_default_disabled'|_ }}
+ {{ 'currencies_switch_default'|_ }}
</p>
{% if currencies|length > 0 %}
<div style="padding-left:8px;">