New upgrade command for recurring transactions #2483

This commit is contained in:
James Cole 2019-08-26 18:38:23 +02:00
parent ac64bac558
commit c2a57a457b
5 changed files with 14 additions and 4 deletions

View File

@ -56,7 +56,7 @@ php artisan cache:clear
php artisan migrate --seed
php artisan firefly-iii:decrypt-all
# there are 12 upgrade commands
# there are 13 upgrade commands
php artisan firefly-iii:transaction-identifiers
php artisan firefly-iii:migrate-to-groups
php artisan firefly-iii:account-currencies
@ -69,6 +69,7 @@ php artisan firefly-iii:bl-currency
php artisan firefly-iii:cc-liabilities
php artisan firefly-iii:back-to-journals
php artisan firefly-iii:rename-account-meta
php artisan firefly-iii:migrate-recurrence-meta
# there are 14 verify commands
php artisan firefly-iii:fix-piggies

View File

@ -110,12 +110,18 @@ class MigrateRecurrenceMeta extends Command
if (null === $firstTransaction) {
return 0;
}
$value = $meta->value;
if ('tags' === $meta->name) {
$array = explode(',', $meta->value);
$value = json_encode($array);
}
RecurrenceTransactionMeta::create(
[
'rt_id' => $firstTransaction->id,
'name' => $meta->name,
'value' => $meta->value,
'value' => $value,
]
);
$meta->forceDelete();

View File

@ -58,7 +58,7 @@ class UpgradeDatabase extends Command
$commands = [
// there are 12 upgrade commands.
// there are 13 upgrade commands.
'firefly-iii:transaction-identifiers',
'firefly-iii:migrate-to-groups',
'firefly-iii:account-currencies',
@ -71,6 +71,7 @@ class UpgradeDatabase extends Command
'firefly-iii:cc-liabilities',
'firefly-iii:back-to-journals',
'firefly-iii:rename-account-meta',
'firefly-iii:migrate-recurrence-meta',
// there are 14 verify commands.
'firefly-iii:fix-piggies',

View File

@ -70,7 +70,7 @@ class InstallController extends Controller
'firefly-iii:decrypt-all' => [],
'generate-keys' => [], // an exception :(
// there are 12 upgrade commands.
// there are 13 upgrade commands.
'firefly-iii:transaction-identifiers' => [],
'firefly-iii:migrate-to-groups' => [],
'firefly-iii:account-currencies' => [],
@ -83,6 +83,7 @@ class InstallController extends Controller
'firefly-iii:cc-liabilities' => [],
'firefly-iii:back-to-journals' => [],
'firefly-iii:rename-account-meta' => [],
'firefly-iii:migrate-recurrence-meta' => [],
// there are 14 verify commands.
'firefly-iii:fix-piggies' => [],

View File

@ -147,6 +147,7 @@
"@php artisan firefly-iii:cc-liabilities",
"@php artisan firefly-iii:back-to-journals",
"@php artisan firefly-iii:rename-account-meta",
"@php artisan firefly-iii:migrate-recurrence-meta",
"@php artisan firefly-iii:fix-piggies",
"@php artisan firefly-iii:create-link-types",