Compare commits

...

18 Commits

Author SHA1 Message Date
github-actions[bot]
74ae59910f Merge pull request #11636 from firefly-iii/release-1770004540
🤖 Automatically merge the PR into the develop branch.
2026-02-02 04:55:48 +01:00
JC5
6d49815be9 🤖 Auto commit for release 'develop' on 2026-02-02 2026-02-02 04:55:40 +01:00
James Cole
1b1ce3e04e Fix more events #11544 2026-01-31 10:41:48 +01:00
James Cole
ff64675122 Fix stored account event. 2026-01-31 10:34:26 +01:00
James Cole
1c545b7a74 Merge branch 'main' into develop 2026-01-31 10:27:40 +01:00
James Cole
a433ddcd7e Clean up events. 2026-01-31 10:27:12 +01:00
James Cole
b0e1b6fe51 Merge pull request #11624 from firefly-iii/dependabot/composer/composer-2f4529dfab
Bump symfony/process from 7.4.3 to 7.4.5 in the composer group across 1 directory
2026-01-29 05:22:35 +01:00
dependabot[bot]
f5523e60b6 Bump symfony/process in the composer group across 1 directory
Bumps the composer group with 1 update in the / directory: [symfony/process](https://github.com/symfony/process).


Updates `symfony/process` from 7.4.3 to 7.4.5
- [Release notes](https://github.com/symfony/process/releases)
- [Changelog](https://github.com/symfony/process/blob/8.1/CHANGELOG.md)
- [Commits](https://github.com/symfony/process/compare/v7.4.3...v7.4.5)

---
updated-dependencies:
- dependency-name: symfony/process
  dependency-version: 7.4.5
  dependency-type: indirect
  dependency-group: composer
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-29 04:08:55 +00:00
James Cole
e300efe640 Merge pull request #11623 from firefly-iii/dependabot/composer/dot-ci/php-cs-fixer/composer-5ee8f56ee5
Bump symfony/process from 8.0.3 to 8.0.5 in /.ci/php-cs-fixer in the composer group across 1 directory
2026-01-29 05:07:50 +01:00
dependabot[bot]
a97f227ddb Bump symfony/process
Bumps the composer group with 1 update in the /.ci/php-cs-fixer directory: [symfony/process](https://github.com/symfony/process).


Updates `symfony/process` from 8.0.3 to 8.0.5
- [Release notes](https://github.com/symfony/process/releases)
- [Changelog](https://github.com/symfony/process/blob/8.1/CHANGELOG.md)
- [Commits](https://github.com/symfony/process/compare/v8.0.3...v8.0.5)

---
updated-dependencies:
- dependency-name: symfony/process
  dependency-version: 8.0.5
  dependency-type: indirect
  dependency-group: composer
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-01-28 21:29:36 +00:00
github-actions[bot]
5f8d7049b5 Merge pull request #11622 from firefly-iii/release-1769628396
🤖 Automatically merge the PR into the develop branch.
2026-01-28 20:26:45 +01:00
JC5
7e80f78f2e 🤖 Auto commit for release 'develop' on 2026-01-28 2026-01-28 20:26:36 +01:00
James Cole
ad922745c4 Fix #11620 2026-01-28 20:22:11 +01:00
github-actions[bot]
40abe74dc1 Merge pull request #11621 from firefly-iii/release-1769627627
🤖 Automatically merge the PR into the develop branch.
2026-01-28 20:13:55 +01:00
JC5
e5d2c4d163 🤖 Auto commit for release 'develop' on 2026-01-28 2026-01-28 20:13:48 +01:00
James Cole
2851053900 Fix nullpointer. 2026-01-28 20:08:32 +01:00
James Cole
b2f6ce1277 Merge pull request #11615 from nick322/feat/11614 2026-01-28 19:38:31 +01:00
Nick Huang
340b0661ba feat(#11614): Add New Taiwan Dollar to Currency Seeder 2026-01-28 15:57:52 +08:00
78 changed files with 1773 additions and 2042 deletions

View File

@@ -402,16 +402,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.93.0",
"version": "v3.93.1",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "50895a07cface1385082e4caa6a6786c4e033468"
"reference": "b3546ab487c0762c39f308dc1ec0ea2c461fc21a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/50895a07cface1385082e4caa6a6786c4e033468",
"reference": "50895a07cface1385082e4caa6a6786c4e033468",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/b3546ab487c0762c39f308dc1ec0ea2c461fc21a",
"reference": "b3546ab487c0762c39f308dc1ec0ea2c461fc21a",
"shasum": ""
},
"require": {
@@ -494,7 +494,7 @@
],
"support": {
"issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues",
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.93.0"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.93.1"
},
"funding": [
{
@@ -502,7 +502,7 @@
"type": "github"
}
],
"time": "2026-01-23T17:33:21+00:00"
"time": "2026-01-28T23:50:50+00:00"
},
{
"name": "psr/container",
@@ -1640,16 +1640,16 @@
},
{
"name": "symfony/finder",
"version": "v8.0.4",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "42e48eb02e07d5f3771d194d67da117eb824c8c1"
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/42e48eb02e07d5f3771d194d67da117eb824c8c1",
"reference": "42e48eb02e07d5f3771d194d67da117eb824c8c1",
"url": "https://api.github.com/repos/symfony/finder/zipball/8bd576e97c67d45941365bf824e18dc8538e6eb0",
"reference": "8bd576e97c67d45941365bf824e18dc8538e6eb0",
"shasum": ""
},
"require": {
@@ -1684,7 +1684,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v8.0.4"
"source": "https://github.com/symfony/finder/tree/v8.0.5"
},
"funding": [
{
@@ -1704,7 +1704,7 @@
"type": "tidelift"
}
],
"time": "2026-01-12T12:37:40+00:00"
"time": "2026-01-26T15:08:38+00:00"
},
{
"name": "symfony/options-resolver",
@@ -2358,16 +2358,16 @@
},
{
"name": "symfony/process",
"version": "v8.0.4",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "10df72602d88c0a3fa685b822976a052611dd607"
"reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/10df72602d88c0a3fa685b822976a052611dd607",
"reference": "10df72602d88c0a3fa685b822976a052611dd607",
"url": "https://api.github.com/repos/symfony/process/zipball/b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674",
"reference": "b5f3aa6762e33fd95efbaa2ec4f4bc9fdd16d674",
"shasum": ""
},
"require": {
@@ -2399,7 +2399,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v8.0.4"
"source": "https://github.com/symfony/process/tree/v8.0.5"
},
"funding": [
{
@@ -2419,7 +2419,7 @@
"type": "tidelift"
}
],
"time": "2026-01-23T11:07:10+00:00"
"time": "2026-01-26T15:08:38+00:00"
},
{
"name": "symfony/service-contracts",

View File

@@ -4,6 +4,7 @@ Over time, many people have contributed to Firefly III. Their efforts are not al
Please find below all the people who contributed to the Firefly III code. Their names are mentioned in the year of their first contribution.
## 2026
- Nick Huang
- mateuszkulapl
- Gianluca Martino
- embedded

View File

@@ -27,6 +27,7 @@ namespace FireflyIII\Api\V1\Controllers\System;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Events\Model\TransactionGroup\CreatedSingleTransactionGroup;
use FireflyIII\Events\Model\TransactionGroup\TransactionGroupEventFlags;
use FireflyIII\Events\Model\TransactionGroup\UserRequestedBatchProcessing;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use Illuminate\Http\JsonResponse;
@@ -64,7 +65,8 @@ class BatchController extends Controller
}
$flags = new TransactionGroupEventFlags();
$flags->applyRules = 'true' === $request->get('apply_rules');
event(new CreatedSingleTransactionGroup($group, $flags));
event(new UserRequestedBatchProcessing($flags));
// event(new CreatedSingleTransactionGroup($group, $flags));
return response()->json([], 204);
}

View File

@@ -1,8 +1,10 @@
<?php
declare(strict_types=1);
/*
* StoredAccount.php
* Copyright (c) 2021 james@firefly-iii.org
* CreatedNewAccount.php
* Copyright (c) 2026 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -20,17 +22,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Events;
namespace FireflyIII\Events\Model\Account;
use FireflyIII\Events\Event;
use FireflyIII\Models\Account;
use Illuminate\Queue\SerializesModels;
/**
* Class StoredAccount
*/
class StoredAccount extends Event
class CreatedNewAccount extends Event
{
use SerializesModels;

View File

@@ -3,7 +3,7 @@
declare(strict_types=1);
/*
* CreatedTransactionGroupBatch.php
* UpdatedExistingAccount.php
* Copyright (c) 2026 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
@@ -22,13 +22,13 @@ declare(strict_types=1);
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
namespace FireflyIII\Events\Model\TransactionGroup;
namespace FireflyIII\Events\Model\Account;
use FireflyIII\Events\Event;
use FireflyIII\Models\Account;
use Illuminate\Queue\SerializesModels;
use Illuminate\Support\Collection;
class CreatedTransactionGroupInBatch extends Event
class UpdatedExistingAccount extends Event
{
use SerializesModels;
@@ -36,7 +36,6 @@ class CreatedTransactionGroupInBatch extends Event
* Create a new event instance.
*/
public function __construct(
public Collection $collection,
public array $flags
public Account $account
) {}
}

View File

@@ -1,8 +1,10 @@
<?php
declare(strict_types=1);
/*
* StoredAccountEventHandler.php
* Copyright (c) 2021 james@firefly-iii.org
* UserRequestedBatchProcessing.php
* Copyright (c) 2026 james@firefly-iii.org
*
* This file is part of Firefly III (https://github.com/firefly-iii).
*
@@ -20,25 +22,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace FireflyIII\Events\Model\TransactionGroup;
namespace FireflyIII\Handlers\Events;
use FireflyIII\Events\Event;
use Illuminate\Support\Facades\Log;
use FireflyIII\Events\StoredAccount;
use FireflyIII\Services\Internal\Support\CreditRecalculateService;
/**
* Class StoredAccountEventHandler
*/
class StoredAccountEventHandler
class UserRequestedBatchProcessing extends Event
{
public function recalculateCredit(StoredAccount $event): void
{
$account = $event->account;
/** @var CreditRecalculateService $object */
$object = app(CreditRecalculateService::class);
$object->setAccount($account);
$object->recalculate();
public function __construct(
public TransactionGroupEventFlags $flags
) {
Log::debug(__METHOD__);
}
}

View File

@@ -25,7 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Factory;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Events\StoredAccount;
use FireflyIII\Events\Model\Account\CreatedNewAccount;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
use FireflyIII\Models\AccountType;
@@ -122,7 +122,7 @@ class AccountFactory
$return = $this->createAccount($type, $data);
event(new StoredAccount($return));
event(new CreatedNewAccount($return));
return $return;
}

View File

@@ -29,10 +29,7 @@ use FireflyIII\Models\Attachment;
use FireflyIII\Models\Transaction;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Repositories\Attachment\AttachmentRepositoryInterface;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
@@ -41,40 +38,6 @@ use Illuminate\Support\Facades\Log;
*/
class AccountObserver
{
public function created(Account $account): void
{
// Log::debug('Observe "created" of an account.');
$this->updatePrimaryCurrencyAmount($account);
}
private function updatePrimaryCurrencyAmount(Account $account): void
{
if (!Amount::convertToPrimary($account->user)) {
return;
}
$userCurrency = Amount::getPrimaryCurrencyByUserGroup($account->user->userGroup);
$repository = app(AccountRepositoryInterface::class);
$currency = $repository->getAccountCurrency($account);
if (
null !== $currency
&& $currency->id !== $userCurrency->id
&& '' !== (string) $account->virtual_balance
&& 0 !== bccomp($account->virtual_balance, '0')
) {
$converter = new ExchangeRateConverter();
$converter->setUserGroup($account->user->userGroup);
$converter->setIgnoreSettings(true);
$account->native_virtual_balance = $converter->convert($currency, $userCurrency, today(), $account->virtual_balance);
}
if ('' === (string) $account->virtual_balance || 0 === bccomp($account->virtual_balance, '0')) {
$account->virtual_balance = null;
$account->native_virtual_balance = null;
}
$account->saveQuietly();
// Log::debug('Account primary currency virtual balance is updated.');
}
/**
* Also delete related objects.
*/
@@ -117,10 +80,4 @@ class AccountObserver
$account->notes()->delete();
$account->locations()->delete();
}
public function updated(Account $account): void
{
// Log::debug('Observe "updated" of an account.');
$this->updatePrimaryCurrencyAmount($account);
}
}

View File

@@ -0,0 +1,84 @@
<?php
declare(strict_types=1);
/*
* TriggersCreditRecalculation.php
* Copyright (c) 2026 james@firefly-iii.org
*
* 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/>.
*/
namespace FireflyIII\Listeners\Model\Account;
use FireflyIII\Events\Model\Account\CreatedNewAccount;
use FireflyIII\Events\Model\Account\UpdatedExistingAccount;
use FireflyIII\Models\Account;
use FireflyIII\Repositories\Account\AccountRepositoryInterface;
use FireflyIII\Services\Internal\Support\CreditRecalculateService;
use FireflyIII\Support\Facades\Amount;
use FireflyIII\Support\Http\Api\ExchangeRateConverter;
use Illuminate\Support\Facades\Log;
class UpdatesAccountInformation
{
public function handle(CreatedNewAccount|UpdatedExistingAccount $event): void
{
$this->recalculateCredit($event->account);
$this->updateVirtualBalance($event->account);
}
private function recalculateCredit(Account $account): void
{
Log::debug('Will call CreditRecalculateService because a new account was created.');
/** @var CreditRecalculateService $object */
$object = app(CreditRecalculateService::class);
$object->setAccount($account);
$object->recalculate();
}
private function updateVirtualBalance(Account $account): void
{
if (!Amount::convertToPrimary($account->user)) {
Log::debug('After account creation, no need to convert virtual balance.');
return;
}
Log::debug('After account creation, convert virtual balance.');
$userCurrency = Amount::getPrimaryCurrencyByUserGroup($account->user->userGroup);
$repository = app(AccountRepositoryInterface::class);
$currency = $repository->getAccountCurrency($account);
if (
null !== $currency
&& $currency->id !== $userCurrency->id
&& '' !== (string) $account->virtual_balance
&& 0 !== bccomp($account->virtual_balance, '0')
) {
$converter = new ExchangeRateConverter();
$converter->setUserGroup($account->user->userGroup);
$converter->setIgnoreSettings(true);
$account->native_virtual_balance = $converter->convert($currency, $userCurrency, today(), $account->virtual_balance);
}
if ('' === (string) $account->virtual_balance || 0 === bccomp($account->virtual_balance, '0')) {
$account->virtual_balance = null;
$account->native_virtual_balance = null;
}
$account->saveQuietly();
// Log::debug('Account primary currency virtual balance is updated.');
}
}

View File

@@ -27,10 +27,12 @@ namespace FireflyIII\Listeners\Model\TransactionGroup;
use Carbon\Carbon;
use FireflyIII\Enums\WebhookTrigger;
use FireflyIII\Events\Model\TransactionGroup\CreatedSingleTransactionGroup;
use FireflyIII\Events\Model\TransactionGroup\UserRequestedBatchProcessing;
use FireflyIII\Events\Model\Webhook\WebhookMessagesRequestSending;
use FireflyIII\Generator\Webhook\MessageGeneratorInterface;
use FireflyIII\Models\Account;
use FireflyIII\Models\TransactionGroup;
use FireflyIII\Models\TransactionJournal;
use FireflyIII\Models\TransactionJournalMeta;
use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\Repositories\PeriodStatistic\PeriodStatisticRepositoryInterface;
@@ -45,21 +47,26 @@ use Illuminate\Support\Facades\Log;
class ProcessesNewTransactionGroup implements ShouldQueue
{
public function handle(CreatedSingleTransactionGroup $event): void
public function handle(CreatedSingleTransactionGroup|UserRequestedBatchProcessing $event): void
{
Log::debug(sprintf('In ProcessesNewTransactionGroup::handle(#%d)', $event->transactionGroup->id));
$groupId = 0;
$collection = new Collection();
if ($event instanceof CreatedSingleTransactionGroup) {
Log::debug(sprintf('In ProcessesNewTransactionGroup::handle(#%d)', $event->transactionGroup->id));
$groupId = $event->transactionGroup->id;
$collection = $event->transactionGroup->transactionJournals;
}
if ($event instanceof UserRequestedBatchProcessing) {
Log::debug('User called UserRequestedBatchProcessing');
}
$setting = FireflyConfig::get('enable_batch_processing', false)->data;
if (true === $event->flags->batchSubmission && true === $setting) {
Log::debug(sprintf(
'Will do nothing for group #%d because it is part of a batch (setting:%s).',
$event->transactionGroup->id,
var_export($setting, true)
));
Log::debug(sprintf('Will do nothing for group #%d because it is part of a batch.', $groupId));
return;
}
Log::debug(sprintf('Will join group #%d with all other open transaction groups and process them.', $event->transactionGroup->id));
$collection = $event->transactionGroup->transactionJournals;
Log::debug(sprintf('Will (joined with group #%d) collect all open transaction groups and process them.', $groupId));
$repository = app(JournalRepositoryInterface::class);
$set = $collection->merge($repository->getUncompletedJournals());
if (0 === $set->count()) {
@@ -67,6 +74,7 @@ class ProcessesNewTransactionGroup implements ShouldQueue
return;
}
Log::debug(sprintf('Set count is %d', $set->count()));
if (!$event->flags->applyRules) {
Log::debug(sprintf('Will NOT process rules for %d journal(s)', $set->count()));
}
@@ -85,12 +93,10 @@ class ProcessesNewTransactionGroup implements ShouldQueue
if ($event->flags->fireWebhooks) {
$this->fireWebhooks($set);
}
// always remove old statistics.
// always remove old relevant statistics.
$this->removePeriodStatistics($set);
// recalculate running balance if necessary.
Log::debug('Observe "created" of a transaction.');
if (true === FireflyConfig::get('use_running_balance', config('firefly.feature_flags.running_balance_column'))->data) {
$this->recalculateRunningBalance($set);
}
@@ -114,8 +120,11 @@ class ProcessesNewTransactionGroup implements ShouldQueue
/** @var Carbon $date */
$date = Carbon::parse($array[0]['data']);
/** @var Carbon $earliest */
$earliest = $date->lt($earliest) ? $date : $earliest;
}
Log::debug(sprintf('Found earliest date: %s', $earliest->toW3cString()));
// get accounts
$accounts = Account::leftJoin('transactions', 'transactions.account_id', 'accounts.id')
@@ -125,6 +134,8 @@ class ProcessesNewTransactionGroup implements ShouldQueue
->get(['accounts.*'])
;
Log::debug('Found accounts to process', $accounts->pluck('id')->toArray());
AccountBalanceCalculator::optimizedCalculation($accounts, $earliest);
}
@@ -143,7 +154,10 @@ class ProcessesNewTransactionGroup implements ShouldQueue
$groups = TransactionGroup::whereIn('id', array_unique($set->pluck('transaction_group_id')->toArray()))->get();
Log::debug(__METHOD__);
$user = $set->first()->user;
/** @var TransactionJournal $first */
$first = $set->first();
$user = $first->user;
/** @var MessageGeneratorInterface $engine */
$engine = app(MessageGeneratorInterface::class);
@@ -175,8 +189,11 @@ class ProcessesNewTransactionGroup implements ShouldQueue
{
Log::debug(sprintf('Will now processRules for %d journal(s)', $set->count()));
$array = $set->pluck('id')->toArray();
/** @var TransactionJournal $first */
$first = $set->first();
$journalIds = implode(',', $array);
$user = $set->first()->user;
$user = $first->user;
Log::debug(sprintf('Add local operator for journal(s): %s', $journalIds));
// collect rules:

View File

@@ -23,14 +23,7 @@ declare(strict_types=1);
namespace FireflyIII\Providers;
use FireflyIII\Events\DestroyedTransactionGroup;
use FireflyIII\Events\Model\TransactionGroup\TriggeredStoredTransactionGroup;
use FireflyIII\Events\Preferences\UserGroupChangedPrimaryCurrency;
use FireflyIII\Events\StoredAccount;
use FireflyIII\Events\UpdatedAccount;
use FireflyIII\Events\UpdatedTransactionGroup;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use Laravel\Passport\Events\AccessTokenCreated;
use Override;
/**

View File

@@ -187,9 +187,11 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
Log::debug(sprintf('Delete statistics for %d transaction journals.', count($set)));
// collect all transactions:
$transactions = Transaction::whereIn('transaction_journal_id', $set->pluck('id')->toArray())->get(['transactions.*']);
Log::debug('Collected transaction IDs', $transactions->pluck('id')->toArray());
// collect all accounts and delete stats:
$accounts = Account::whereIn('id', $transactions->pluck('account_id')->toArray())->get(['accounts.*']);
Log::debug('Collected account IDs', $accounts->pluck('id')->toArray());
$dates = $set->pluck('date');
$this->deleteStatisticsForType(Account::class, $accounts, $dates);
@@ -202,6 +204,7 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
->pluck('category_id')
->toArray()
)->get(['categories.*']);
Log::debug('Collected category IDs', $categories->pluck('id')->toArray());
$this->deleteStatisticsForType(Category::class, $categories, $dates);
// budgets, same thing
@@ -213,6 +216,7 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
->pluck('budget_id')
->toArray()
)->get(['budgets.*']);
Log::debug('Collected budget IDs', $categories->pluck('id')->toArray());
$this->deleteStatisticsForType(Budget::class, $budgets, $dates);
// tags
@@ -224,16 +228,20 @@ class PeriodStatisticRepository implements PeriodStatisticRepositoryInterface, U
->pluck('tag_id')
->toArray()
)->get(['tags.*']);
Log::debug('Collected tag IDs', $categories->pluck('id')->toArray());
$this->deleteStatisticsForType(Tag::class, $tags, $dates);
// remove for no tag, no cat, etc.
if (0 === $categories->count()) {
Log::debug('No categories, delete "no_category" stats.');
$this->deleteStatisticsForPrefix('no_category', $dates);
}
if (0 === $budgets->count()) {
Log::debug('No budgets, delete "no_category" stats.');
$this->deleteStatisticsForPrefix('no_budget', $dates);
}
if (0 === $tags->count()) {
Log::debug('No tags, delete "no_category" stats.');
$this->deleteStatisticsForPrefix('no_tag', $dates);
}
}

View File

@@ -25,6 +25,7 @@ declare(strict_types=1);
namespace FireflyIII\Services\Internal\Update;
use FireflyIII\Enums\AccountTypeEnum;
use FireflyIII\Events\Model\Account\UpdatedExistingAccount;
use FireflyIII\Events\UpdatedAccount;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Account;
@@ -150,6 +151,8 @@ class AccountUpdateService
$account->save();
event(new UpdatedExistingAccount($account));
return $account;
}

View File

@@ -114,7 +114,7 @@ class SubscriptionEnrichment implements EnrichmentInterface
$amounts['pc_amount_min'] = Steam::bcround($item->native_amount_min, $this->primaryCurrency->decimal_places);
$amounts['pc_amount_max'] = Steam::bcround($item->native_amount_max, $this->primaryCurrency->decimal_places);
$amounts['pc_average'] = Steam::bcround(
bcdiv(bcadd($item->native_amount_min, $item->native_amount_max), '2'),
bcdiv(bcadd($item->native_amount_min ?? '0', $item->native_amount_max ?? '0'), '2'),
$this->primaryCurrency->decimal_places
);
}

162
composer.lock generated
View File

@@ -130,16 +130,16 @@
},
{
"name": "brick/math",
"version": "0.14.1",
"version": "0.14.3",
"source": {
"type": "git",
"url": "https://github.com/brick/math.git",
"reference": "f05858549e5f9d7bb45875a75583240a38a281d0"
"reference": "6af96b11de3f7d99730c118c200418c48274edb4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/brick/math/zipball/f05858549e5f9d7bb45875a75583240a38a281d0",
"reference": "f05858549e5f9d7bb45875a75583240a38a281d0",
"url": "https://api.github.com/repos/brick/math/zipball/6af96b11de3f7d99730c118c200418c48274edb4",
"reference": "6af96b11de3f7d99730c118c200418c48274edb4",
"shasum": ""
},
"require": {
@@ -178,7 +178,7 @@
],
"support": {
"issues": "https://github.com/brick/math/issues",
"source": "https://github.com/brick/math/tree/0.14.1"
"source": "https://github.com/brick/math/tree/0.14.3"
},
"funding": [
{
@@ -186,7 +186,7 @@
"type": "github"
}
],
"time": "2025-11-24T14:40:29+00:00"
"time": "2026-02-01T15:18:05+00:00"
},
{
"name": "carbonphp/carbon-doctrine-types",
@@ -3724,16 +3724,16 @@
},
{
"name": "nesbot/carbon",
"version": "3.11.0",
"version": "3.11.1",
"source": {
"type": "git",
"url": "https://github.com/CarbonPHP/carbon.git",
"reference": "bdb375400dcd162624531666db4799b36b64e4a1"
"reference": "f438fcc98f92babee98381d399c65336f3a3827f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/bdb375400dcd162624531666db4799b36b64e4a1",
"reference": "bdb375400dcd162624531666db4799b36b64e4a1",
"url": "https://api.github.com/repos/CarbonPHP/carbon/zipball/f438fcc98f92babee98381d399c65336f3a3827f",
"reference": "f438fcc98f92babee98381d399c65336f3a3827f",
"shasum": ""
},
"require": {
@@ -3757,7 +3757,7 @@
"phpstan/extension-installer": "^1.4.3",
"phpstan/phpstan": "^2.1.22",
"phpunit/phpunit": "^10.5.53",
"squizlabs/php_codesniffer": "^3.13.4"
"squizlabs/php_codesniffer": "^3.13.4 || ^4.0.0"
},
"bin": [
"bin/carbon"
@@ -3800,14 +3800,14 @@
}
],
"description": "An API extension for DateTime that supports 281 different languages.",
"homepage": "https://carbon.nesbot.com",
"homepage": "https://carbonphp.github.io/carbon/",
"keywords": [
"date",
"datetime",
"time"
],
"support": {
"docs": "https://carbon.nesbot.com/docs",
"docs": "https://carbonphp.github.io/carbon/guide/getting-started/introduction.html",
"issues": "https://github.com/CarbonPHP/carbon/issues",
"source": "https://github.com/CarbonPHP/carbon"
},
@@ -3825,7 +3825,7 @@
"type": "tidelift"
}
],
"time": "2025-12-02T21:04:28+00:00"
"time": "2026-01-29T09:26:29+00:00"
},
{
"name": "nette/schema",
@@ -6428,16 +6428,16 @@
},
{
"name": "symfony/cache",
"version": "v8.0.4",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/cache.git",
"reference": "5d3fcada5e1b80157cfdfd1f9dbbd63f95ef6f13"
"reference": "92e9960386c7e01f58198038c199d522959a843c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/cache/zipball/5d3fcada5e1b80157cfdfd1f9dbbd63f95ef6f13",
"reference": "5d3fcada5e1b80157cfdfd1f9dbbd63f95ef6f13",
"url": "https://api.github.com/repos/symfony/cache/zipball/92e9960386c7e01f58198038c199d522959a843c",
"reference": "92e9960386c7e01f58198038c199d522959a843c",
"shasum": ""
},
"require": {
@@ -6504,7 +6504,7 @@
"psr6"
],
"support": {
"source": "https://github.com/symfony/cache/tree/v8.0.4"
"source": "https://github.com/symfony/cache/tree/v8.0.5"
},
"funding": [
{
@@ -6524,7 +6524,7 @@
"type": "tidelift"
}
],
"time": "2026-01-23T12:59:31+00:00"
"time": "2026-01-27T16:18:07+00:00"
},
{
"name": "symfony/cache-contracts",
@@ -7225,16 +7225,16 @@
},
{
"name": "symfony/finder",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "01b24a145bbeaa7141e75887ec904c34a6728a5f"
"reference": "ad4daa7c38668dcb031e63bc99ea9bd42196a2cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/01b24a145bbeaa7141e75887ec904c34a6728a5f",
"reference": "01b24a145bbeaa7141e75887ec904c34a6728a5f",
"url": "https://api.github.com/repos/symfony/finder/zipball/ad4daa7c38668dcb031e63bc99ea9bd42196a2cb",
"reference": "ad4daa7c38668dcb031e63bc99ea9bd42196a2cb",
"shasum": ""
},
"require": {
@@ -7269,7 +7269,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v7.4.4"
"source": "https://github.com/symfony/finder/tree/v7.4.5"
},
"funding": [
{
@@ -7289,20 +7289,20 @@
"type": "tidelift"
}
],
"time": "2026-01-12T12:19:02+00:00"
"time": "2026-01-26T15:07:59+00:00"
},
{
"name": "symfony/http-client",
"version": "v8.0.4",
"version": "v8.0.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-client.git",
"reference": "ee9cc4a32fd1cb202b052ba9905a3c873363a465"
"reference": "f9fdd372473e66469c6d32a4ed12efcffdea38c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-client/zipball/ee9cc4a32fd1cb202b052ba9905a3c873363a465",
"reference": "ee9cc4a32fd1cb202b052ba9905a3c873363a465",
"url": "https://api.github.com/repos/symfony/http-client/zipball/f9fdd372473e66469c6d32a4ed12efcffdea38c4",
"reference": "f9fdd372473e66469c6d32a4ed12efcffdea38c4",
"shasum": ""
},
"require": {
@@ -7365,7 +7365,7 @@
"http"
],
"support": {
"source": "https://github.com/symfony/http-client/tree/v8.0.4"
"source": "https://github.com/symfony/http-client/tree/v8.0.5"
},
"funding": [
{
@@ -7385,7 +7385,7 @@
"type": "tidelift"
}
],
"time": "2026-01-23T16:34:51+00:00"
"time": "2026-01-27T16:18:07+00:00"
},
{
"name": "symfony/http-client-contracts",
@@ -7467,16 +7467,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "977a554a34cf8edc95ca351fbecb1bb1ad05cc94"
"reference": "446d0db2b1f21575f1284b74533e425096abdfb6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/977a554a34cf8edc95ca351fbecb1bb1ad05cc94",
"reference": "977a554a34cf8edc95ca351fbecb1bb1ad05cc94",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/446d0db2b1f21575f1284b74533e425096abdfb6",
"reference": "446d0db2b1f21575f1284b74533e425096abdfb6",
"shasum": ""
},
"require": {
@@ -7525,7 +7525,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v7.4.4"
"source": "https://github.com/symfony/http-foundation/tree/v7.4.5"
},
"funding": [
{
@@ -7545,20 +7545,20 @@
"type": "tidelift"
}
],
"time": "2026-01-09T12:14:21+00:00"
"time": "2026-01-27T16:16:02+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "48b067768859f7b68acf41dfb857a5a4be00acdd"
"reference": "229eda477017f92bd2ce7615d06222ec0c19e82a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/48b067768859f7b68acf41dfb857a5a4be00acdd",
"reference": "48b067768859f7b68acf41dfb857a5a4be00acdd",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/229eda477017f92bd2ce7615d06222ec0c19e82a",
"reference": "229eda477017f92bd2ce7615d06222ec0c19e82a",
"shasum": ""
},
"require": {
@@ -7644,7 +7644,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v7.4.4"
"source": "https://github.com/symfony/http-kernel/tree/v7.4.5"
},
"funding": [
{
@@ -7664,7 +7664,7 @@
"type": "tidelift"
}
],
"time": "2026-01-24T22:13:01+00:00"
"time": "2026-01-28T10:33:42+00:00"
},
{
"name": "symfony/mailer",
@@ -7822,16 +7822,16 @@
},
{
"name": "symfony/mime",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "40945014c0a9471ccfe19673c54738fa19367a3c"
"reference": "b18c7e6e9eee1e19958138df10412f3c4c316148"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/40945014c0a9471ccfe19673c54738fa19367a3c",
"reference": "40945014c0a9471ccfe19673c54738fa19367a3c",
"url": "https://api.github.com/repos/symfony/mime/zipball/b18c7e6e9eee1e19958138df10412f3c4c316148",
"reference": "b18c7e6e9eee1e19958138df10412f3c4c316148",
"shasum": ""
},
"require": {
@@ -7842,15 +7842,15 @@
},
"conflict": {
"egulias/email-validator": "~3.0.0",
"phpdocumentor/reflection-docblock": "<3.2.2",
"phpdocumentor/type-resolver": "<1.4.0",
"phpdocumentor/reflection-docblock": "<5.2|>=6",
"phpdocumentor/type-resolver": "<1.5.1",
"symfony/mailer": "<6.4",
"symfony/serializer": "<6.4.3|>7.0,<7.0.3"
},
"require-dev": {
"egulias/email-validator": "^2.1.10|^3.1|^4",
"league/html-to-markdown": "^5.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
"phpdocumentor/reflection-docblock": "^5.2",
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
"symfony/process": "^6.4|^7.0|^8.0",
"symfony/property-access": "^6.4|^7.0|^8.0",
@@ -7887,7 +7887,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v7.4.4"
"source": "https://github.com/symfony/mime/tree/v7.4.5"
},
"funding": [
{
@@ -7907,7 +7907,7 @@
"type": "tidelift"
}
],
"time": "2026-01-08T16:12:55+00:00"
"time": "2026-01-27T08:59:58+00:00"
},
{
"name": "symfony/options-resolver",
@@ -8811,16 +8811,16 @@
},
{
"name": "symfony/process",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "626f07a53f4b4e2f00e11824cc29f928d797783b"
"reference": "608476f4604102976d687c483ac63a79ba18cc97"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/626f07a53f4b4e2f00e11824cc29f928d797783b",
"reference": "626f07a53f4b4e2f00e11824cc29f928d797783b",
"url": "https://api.github.com/repos/symfony/process/zipball/608476f4604102976d687c483ac63a79ba18cc97",
"reference": "608476f4604102976d687c483ac63a79ba18cc97",
"shasum": ""
},
"require": {
@@ -8852,7 +8852,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v7.4.4"
"source": "https://github.com/symfony/process/tree/v7.4.5"
},
"funding": [
{
@@ -8872,7 +8872,7 @@
"type": "tidelift"
}
],
"time": "2026-01-20T09:23:51+00:00"
"time": "2026-01-26T15:07:59+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
@@ -10530,16 +10530,16 @@
},
{
"name": "fruitcake/laravel-debugbar",
"version": "v4.0.3",
"version": "v4.0.5",
"source": {
"type": "git",
"url": "https://github.com/fruitcake/laravel-debugbar.git",
"reference": "9eec3770a304c52d1dd71577b44bbb9ab904f5d8"
"reference": "1da86437d28f36baf3bb9841d77e74cb639372a9"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/9eec3770a304c52d1dd71577b44bbb9ab904f5d8",
"reference": "9eec3770a304c52d1dd71577b44bbb9ab904f5d8",
"url": "https://api.github.com/repos/fruitcake/laravel-debugbar/zipball/1da86437d28f36baf3bb9841d77e74cb639372a9",
"reference": "1da86437d28f36baf3bb9841d77e74cb639372a9",
"shasum": ""
},
"require": {
@@ -10616,7 +10616,7 @@
],
"support": {
"issues": "https://github.com/fruitcake/laravel-debugbar/issues",
"source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.0.3"
"source": "https://github.com/fruitcake/laravel-debugbar/tree/v4.0.5"
},
"funding": [
{
@@ -10628,7 +10628,7 @@
"type": "github"
}
],
"time": "2026-01-26T18:25:58+00:00"
"time": "2026-01-29T19:18:02+00:00"
},
{
"name": "hamcrest/hamcrest-php",
@@ -11198,16 +11198,16 @@
},
{
"name": "php-debugbar/php-debugbar",
"version": "v3.2.3",
"version": "v3.3.0",
"source": {
"type": "git",
"url": "https://github.com/php-debugbar/php-debugbar.git",
"reference": "0c61c6023742c76bc3678100ed6bc52dc4c8d434"
"reference": "e22287890107602af6a113dc7975b3d77c542e5f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/0c61c6023742c76bc3678100ed6bc52dc4c8d434",
"reference": "0c61c6023742c76bc3678100ed6bc52dc4c8d434",
"url": "https://api.github.com/repos/php-debugbar/php-debugbar/zipball/e22287890107602af6a113dc7975b3d77c542e5f",
"reference": "e22287890107602af6a113dc7975b3d77c542e5f",
"shasum": ""
},
"require": {
@@ -11284,7 +11284,7 @@
],
"support": {
"issues": "https://github.com/php-debugbar/php-debugbar/issues",
"source": "https://github.com/php-debugbar/php-debugbar/tree/v3.2.3"
"source": "https://github.com/php-debugbar/php-debugbar/tree/v3.3.0"
},
"funding": [
{
@@ -11296,7 +11296,7 @@
"type": "github"
}
],
"time": "2026-01-27T10:26:33+00:00"
"time": "2026-01-28T12:57:47+00:00"
},
{
"name": "php-debugbar/symfony-bridge",
@@ -11414,11 +11414,11 @@
},
{
"name": "phpstan/phpstan",
"version": "2.1.37",
"version": "2.1.38",
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/28cd424c5ea984128c95cfa7ea658808e8954e49",
"reference": "28cd424c5ea984128c95cfa7ea658808e8954e49",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/dfaf1f530e1663aa167bc3e52197adb221582629",
"reference": "dfaf1f530e1663aa167bc3e52197adb221582629",
"shasum": ""
},
"require": {
@@ -11463,7 +11463,7 @@
"type": "github"
}
],
"time": "2026-01-24T08:21:55+00:00"
"time": "2026-01-30T17:12:46+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",
@@ -12001,16 +12001,16 @@
},
{
"name": "rector/rector",
"version": "2.3.4",
"version": "2.3.5",
"source": {
"type": "git",
"url": "https://github.com/rectorphp/rector.git",
"reference": "9227d7a24b0f23ae941057509364f948d5da9ab2"
"reference": "9442f4037de6a5347ae157fe8e6c7cda9d909070"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/9227d7a24b0f23ae941057509364f948d5da9ab2",
"reference": "9227d7a24b0f23ae941057509364f948d5da9ab2",
"url": "https://api.github.com/repos/rectorphp/rector/zipball/9442f4037de6a5347ae157fe8e6c7cda9d909070",
"reference": "9442f4037de6a5347ae157fe8e6c7cda9d909070",
"shasum": ""
},
"require": {
@@ -12049,7 +12049,7 @@
],
"support": {
"issues": "https://github.com/rectorphp/rector/issues",
"source": "https://github.com/rectorphp/rector/tree/2.3.4"
"source": "https://github.com/rectorphp/rector/tree/2.3.5"
},
"funding": [
{
@@ -12057,7 +12057,7 @@
"type": "github"
}
],
"time": "2026-01-21T14:49:03+00:00"
"time": "2026-01-28T15:22:48+00:00"
},
{
"name": "sebastian/cli-parser",

View File

@@ -78,8 +78,8 @@ return [
'running_balance_column' => (bool)envNonEmpty('USE_RUNNING_BALANCE', true), // this is only the default value, is not used.
// see cer.php for exchange rates feature flag.
],
'version' => 'develop/2026-01-28',
'build_time' => 1769573193,
'version' => 'develop/2026-02-02',
'build_time' => 1770004409,
'api_version' => '2.1.0', // field is no longer used.
'db_version' => 28, // field is no longer used.

View File

@@ -76,17 +76,14 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('account_types')) {
try {
Schema::create(
'account_types',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('type', 50);
Schema::create('account_types', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('type', 50);
// type must be unique.
$table->unique(['type']);
}
);
// type must be unique.
$table->unique(['type']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'account_types', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -98,20 +95,17 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('transaction_currencies')) {
try {
Schema::create(
'transaction_currencies',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('code', 3);
$table->string('name', 255);
$table->string('symbol', 12);
Schema::create('transaction_currencies', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('code', 3);
$table->string('name', 255);
$table->string('symbol', 12);
// code must be unique.
$table->unique(['code']);
}
);
// code must be unique.
$table->unique(['code']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'transaction_currencies', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -123,18 +117,15 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('transaction_types')) {
try {
Schema::create(
'transaction_types',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('type', 50);
Schema::create('transaction_types', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('type', 50);
// type must be unique.
$table->unique(['type']);
}
);
// type must be unique.
$table->unique(['type']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'transaction_types', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -146,21 +137,18 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('jobs')) {
try {
Schema::create(
'jobs',
static function (Blueprint $table): void {
// straight from Laravel
$table->bigIncrements('id');
$table->string('queue');
$table->longText('payload');
$table->tinyInteger('attempts')->unsigned();
$table->tinyInteger('reserved')->unsigned();
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
$table->index(['queue', 'reserved', 'reserved_at']);
}
);
Schema::create('jobs', static function (Blueprint $table): void {
// straight from Laravel
$table->bigIncrements('id');
$table->string('queue');
$table->longText('payload');
$table->tinyInteger('attempts')->unsigned();
$table->tinyInteger('reserved')->unsigned();
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
$table->index(['queue', 'reserved', 'reserved_at']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'jobs', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -172,15 +160,12 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('password_resets')) {
try {
Schema::create(
'password_resets',
static function (Blueprint $table): void {
// straight from laravel
$table->string('email')->index();
$table->string('token')->index();
$table->timestamp('created_at')->nullable();
}
);
Schema::create('password_resets', static function (Blueprint $table): void {
// straight from laravel
$table->string('email')->index();
$table->string('token')->index();
$table->timestamp('created_at')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'password_resets', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -192,16 +177,13 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('permissions')) {
try {
Schema::create(
'permissions',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
}
);
Schema::create('permissions', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'permissions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -213,16 +195,13 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('roles')) {
try {
Schema::create(
'roles',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
}
);
Schema::create('roles', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'roles', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -234,18 +213,15 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('permission_role')) {
try {
Schema::create(
'permission_role',
static function (Blueprint $table): void {
$table->integer('permission_id')->unsigned();
$table->integer('role_id')->unsigned();
Schema::create('permission_role', static function (Blueprint $table): void {
$table->integer('permission_id')->unsigned();
$table->integer('role_id')->unsigned();
$table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('permission_id')->references('id')->on('permissions')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
$table->primary(['permission_id', 'role_id']);
}
);
$table->primary(['permission_id', 'role_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'permission_role', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -257,17 +233,14 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('sessions')) {
try {
Schema::create(
'sessions',
static function (Blueprint $table): void {
$table->string('id')->unique();
$table->integer('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->text('payload');
$table->integer('last_activity');
}
);
Schema::create('sessions', static function (Blueprint $table): void {
$table->string('id')->unique();
$table->integer('user_id')->nullable();
$table->string('ip_address', 45)->nullable();
$table->text('user_agent')->nullable();
$table->text('payload');
$table->integer('last_activity');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'sessions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -279,16 +252,13 @@ class CreateSupportTables extends Migration
{
if (!Schema::hasTable('configuration')) {
try {
Schema::create(
'configuration',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('name', 50);
$table->text('data');
}
);
Schema::create('configuration', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('name', 50);
$table->text('data');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'configuration', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);

View File

@@ -53,19 +53,16 @@ class CreateUsersTable extends Migration
{
if (!Schema::hasTable('users')) {
try {
Schema::create(
'users',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('email', 255);
$table->string('password', 60);
$table->string('remember_token', 100)->nullable();
$table->string('reset', 32)->nullable();
$table->tinyInteger('blocked', false, true)->default('0');
$table->string('blocked_code', 25)->nullable();
}
);
Schema::create('users', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->string('email', 255);
$table->string('password', 60);
$table->string('remember_token', 100)->nullable();
$table->string('reset', 32)->nullable();
$table->tinyInteger('blocked', false, true)->default('0');
$table->string('blocked_code', 25)->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'users', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);

View File

@@ -95,23 +95,20 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('accounts')) {
try {
Schema::create(
'accounts',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('account_type_id', false, true);
$table->string('name', 1024);
$table->decimal('virtual_balance', 32, 12)->nullable();
$table->string('iban', 255)->nullable();
$table->boolean('active')->default(1);
$table->boolean('encrypted')->default(0);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
}
);
Schema::create('accounts', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('account_type_id', false, true);
$table->string('name', 1024);
$table->decimal('virtual_balance', 32, 12)->nullable();
$table->string('iban', 255)->nullable();
$table->boolean('active')->default(1);
$table->boolean('encrypted')->default(0);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('account_type_id')->references('id')->on('account_types')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'accounts', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -120,17 +117,14 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('account_meta')) {
try {
Schema::create(
'account_meta',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('account_id', false, true);
$table->string('name');
$table->text('data');
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
}
);
Schema::create('account_meta', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('account_id', false, true);
$table->string('name');
$table->text('data');
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'account_meta', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -142,23 +136,20 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('piggy_banks')) {
try {
Schema::create(
'piggy_banks',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('account_id', false, true);
$table->string('name', 1024);
$table->decimal('targetamount', 32, 12);
$table->date('startdate')->nullable();
$table->date('targetdate')->nullable();
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(0);
$table->boolean('encrypted')->default(1);
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
}
);
Schema::create('piggy_banks', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('account_id', false, true);
$table->string('name', 1024);
$table->decimal('targetamount', 32, 12);
$table->date('startdate')->nullable();
$table->date('targetdate')->nullable();
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(0);
$table->boolean('encrypted')->default(1);
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'piggy_banks', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -167,18 +158,15 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('piggy_bank_repetitions')) {
try {
Schema::create(
'piggy_bank_repetitions',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('piggy_bank_id', false, true);
$table->date('startdate')->nullable();
$table->date('targetdate')->nullable();
$table->decimal('currentamount', 32, 12);
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
}
);
Schema::create('piggy_bank_repetitions', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('piggy_bank_id', false, true);
$table->date('startdate')->nullable();
$table->date('targetdate')->nullable();
$table->decimal('currentamount', 32, 12);
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'piggy_bank_repetitions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -190,28 +178,25 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('attachments')) {
try {
Schema::create(
'attachments',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('attachable_id', false, true);
$table->string('attachable_type', 255);
$table->string('md5', 128);
$table->string('filename', 1024);
$table->string('title', 1024)->nullable();
$table->text('description')->nullable();
$table->text('notes')->nullable();
$table->string('mime', 1024);
$table->integer('size', false, true);
$table->boolean('uploaded')->default(1);
Schema::create('attachments', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('attachable_id', false, true);
$table->string('attachable_type', 255);
$table->string('md5', 128);
$table->string('filename', 1024);
$table->string('title', 1024)->nullable();
$table->text('description')->nullable();
$table->text('notes')->nullable();
$table->string('mime', 1024);
$table->integer('size', false, true);
$table->boolean('uploaded')->default(1);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'attachments', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -223,29 +208,26 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('bills')) {
try {
Schema::create(
'bills',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->string('match', 1024);
$table->decimal('amount_min', 32, 12);
$table->decimal('amount_max', 32, 12);
$table->date('date');
$table->string('repeat_freq', 30);
$table->smallInteger('skip', false, true)->default(0);
$table->boolean('automatch')->default(1);
$table->boolean('active')->default(1);
$table->boolean('name_encrypted')->default(0);
$table->boolean('match_encrypted')->default(0);
Schema::create('bills', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->string('match', 1024);
$table->decimal('amount_min', 32, 12);
$table->decimal('amount_max', 32, 12);
$table->date('date');
$table->string('repeat_freq', 30);
$table->smallInteger('skip', false, true)->default(0);
$table->boolean('automatch')->default(1);
$table->boolean('active')->default(1);
$table->boolean('name_encrypted')->default(0);
$table->boolean('match_encrypted')->default(0);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'bills', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -257,19 +239,16 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('budgets')) {
try {
Schema::create(
'budgets',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->boolean('active')->default(1);
$table->boolean('encrypted')->default(0);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
Schema::create('budgets', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->boolean('active')->default(1);
$table->boolean('encrypted')->default(0);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'budgets', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -277,19 +256,16 @@ class CreateMainTables extends Migration
}
if (!Schema::hasTable('budget_limits')) {
try {
Schema::create(
'budget_limits',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('budget_id', false, true);
$table->date('startdate');
$table->decimal('amount', 32, 12);
$table->string('repeat_freq', 30)->nullable();
$table->boolean('repeats')->default(0);
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
}
);
Schema::create('budget_limits', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('budget_id', false, true);
$table->date('startdate');
$table->decimal('amount', 32, 12);
$table->string('repeat_freq', 30)->nullable();
$table->boolean('repeats')->default(0);
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'budget_limits', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -301,20 +277,17 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('categories')) {
try {
Schema::create(
'categories',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->boolean('encrypted')->default(0);
Schema::create('categories', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->boolean('encrypted')->default(0);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'categories', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -326,18 +299,15 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('preferences')) {
try {
Schema::create(
'preferences',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->text('data');
Schema::create('preferences', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('user_id', false, true);
$table->string('name', 1024);
$table->text('data');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'preferences', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -349,18 +319,15 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('role_user')) {
try {
Schema::create(
'role_user',
static function (Blueprint $table): void {
$table->integer('user_id', false, true);
$table->integer('role_id', false, true);
Schema::create('role_user', static function (Blueprint $table): void {
$table->integer('user_id', false, true);
$table->integer('role_id', false, true);
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('role_id')->references('id')->on('roles')->onUpdate('cascade')->onDelete('cascade');
$table->primary(['user_id', 'role_id']);
}
);
$table->primary(['user_id', 'role_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'role_user', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -375,22 +342,19 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('rule_groups')) {
try {
Schema::create(
'rule_groups',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('title', 255);
$table->text('description')->nullable();
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
Schema::create('rule_groups', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('title', 255);
$table->text('description')->nullable();
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'rule_groups', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -398,27 +362,24 @@ class CreateMainTables extends Migration
}
if (!Schema::hasTable('rules')) {
try {
Schema::create(
'rules',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('rule_group_id', false, true);
$table->string('title', 255);
$table->text('description')->nullable();
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
$table->boolean('stop_processing')->default(0);
Schema::create('rules', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('rule_group_id', false, true);
$table->string('title', 255);
$table->text('description')->nullable();
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
$table->boolean('stop_processing')->default(0);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
// link rule group id to rule group table
$table->foreign('rule_group_id')->references('id')->on('rule_groups')->onDelete('cascade');
}
);
// link rule group id to rule group table
$table->foreign('rule_group_id')->references('id')->on('rule_groups')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'rules', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -426,24 +387,21 @@ class CreateMainTables extends Migration
}
if (!Schema::hasTable('rule_actions')) {
try {
Schema::create(
'rule_actions',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('rule_id', false, true);
Schema::create('rule_actions', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('rule_id', false, true);
$table->string('action_type', 50);
$table->string('action_value', 255);
$table->string('action_type', 50);
$table->string('action_value', 255);
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
$table->boolean('stop_processing')->default(0);
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
$table->boolean('stop_processing')->default(0);
// link rule id to rules table
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
}
);
// link rule id to rules table
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'rule_actions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -451,24 +409,21 @@ class CreateMainTables extends Migration
}
if (!Schema::hasTable('rule_triggers')) {
try {
Schema::create(
'rule_triggers',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('rule_id', false, true);
Schema::create('rule_triggers', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('rule_id', false, true);
$table->string('trigger_type', 50);
$table->string('trigger_value', 255);
$table->string('trigger_type', 50);
$table->string('trigger_value', 255);
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
$table->boolean('stop_processing')->default(0);
$table->integer('order', false, true)->default(0);
$table->boolean('active')->default(1);
$table->boolean('stop_processing')->default(0);
// link rule id to rules table
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
}
);
// link rule id to rules table
$table->foreign('rule_id')->references('id')->on('rules')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'rule_triggers', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -480,26 +435,23 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('tags')) {
try {
Schema::create(
'tags',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
Schema::create('tags', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('tag', 1024);
$table->string('tagMode', 1024);
$table->date('date')->nullable();
$table->text('description')->nullable();
$table->decimal('latitude', 12, 8)->nullable();
$table->decimal('longitude', 12, 8)->nullable();
$table->smallInteger('zoomLevel', false, true)->nullable();
$table->string('tag', 1024);
$table->string('tagMode', 1024);
$table->date('date')->nullable();
$table->text('description')->nullable();
$table->decimal('latitude', 12, 8)->nullable();
$table->decimal('longitude', 12, 8)->nullable();
$table->smallInteger('zoomLevel', false, true)->nullable();
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
// link user id to users table
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'tags', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -515,31 +467,28 @@ class CreateMainTables extends Migration
{
if (!Schema::hasTable('transaction_journals')) {
try {
Schema::create(
'transaction_journals',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('transaction_type_id', false, true);
$table->integer('bill_id', false, true)->nullable();
$table->integer('transaction_currency_id', false, true);
$table->string('description', 1024);
$table->date('date');
$table->date('interest_date')->nullable();
$table->date('book_date')->nullable();
$table->date('process_date')->nullable();
$table->integer('order', false, true)->default(0);
$table->integer('tag_count', false, true);
$table->boolean('encrypted')->default(1);
$table->boolean('completed')->default(1);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
$table->foreign('bill_id')->references('id')->on('bills')->onDelete('set null');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
}
);
Schema::create('transaction_journals', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('transaction_type_id', false, true);
$table->integer('bill_id', false, true)->nullable();
$table->integer('transaction_currency_id', false, true);
$table->string('description', 1024);
$table->date('date');
$table->date('interest_date')->nullable();
$table->date('book_date')->nullable();
$table->date('process_date')->nullable();
$table->integer('order', false, true)->default(0);
$table->integer('tag_count', false, true);
$table->boolean('encrypted')->default(1);
$table->boolean('completed')->default(1);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
$table->foreign('bill_id')->references('id')->on('bills')->onDelete('set null');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'transaction_journals', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -548,18 +497,15 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('journal_meta')) {
try {
Schema::create(
'journal_meta',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('transaction_journal_id', false, true);
$table->string('name', 255);
$table->text('data');
$table->string('hash', 64);
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
}
);
Schema::create('journal_meta', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('transaction_journal_id', false, true);
$table->string('name', 255);
$table->text('data');
$table->string('hash', 64);
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'journal_meta', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -568,19 +514,16 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('tag_transaction_journal')) {
try {
Schema::create(
'tag_transaction_journal',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('tag_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
Schema::create('tag_transaction_journal', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('tag_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->foreign('tag_id')->references('id')->on('tags')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
// unique combi:
$table->unique(['tag_id', 'transaction_journal_id']);
}
);
// unique combi:
$table->unique(['tag_id', 'transaction_journal_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'tag_transaction_journal', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -589,16 +532,13 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('budget_transaction_journal')) {
try {
Schema::create(
'budget_transaction_journal',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('budget_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
}
);
Schema::create('budget_transaction_journal', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('budget_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'budget_transaction_journal', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -607,16 +547,13 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('category_transaction_journal')) {
try {
Schema::create(
'category_transaction_journal',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('category_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
}
);
Schema::create('category_transaction_journal', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('category_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'category_transaction_journal', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -625,20 +562,17 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('piggy_bank_events')) {
try {
Schema::create(
'piggy_bank_events',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('piggy_bank_id', false, true);
$table->integer('transaction_journal_id', false, true)->nullable();
$table->date('date');
$table->decimal('amount', 32, 12);
Schema::create('piggy_bank_events', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('piggy_bank_id', false, true);
$table->integer('transaction_journal_id', false, true)->nullable();
$table->date('date');
$table->decimal('amount', 32, 12);
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
}
);
$table->foreign('piggy_bank_id')->references('id')->on('piggy_banks')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('set null');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'piggy_bank_events', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -647,21 +581,18 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('transactions')) {
try {
Schema::create(
'transactions',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('account_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->string('description', 1024)->nullable();
$table->decimal('amount', 32, 12);
Schema::create('transactions', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('account_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->string('description', 1024)->nullable();
$table->decimal('amount', 32, 12);
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
}
);
$table->foreign('account_id')->references('id')->on('accounts')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'transactions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -670,17 +601,14 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('budget_transaction')) {
try {
Schema::create(
'budget_transaction',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('budget_id', false, true);
$table->integer('transaction_id', false, true);
Schema::create('budget_transaction', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('budget_id', false, true);
$table->integer('transaction_id', false, true);
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
}
);
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'budget_transaction', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -689,17 +617,14 @@ class CreateMainTables extends Migration
if (!Schema::hasTable('category_transaction')) {
try {
Schema::create(
'category_transaction',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('category_id', false, true);
$table->integer('transaction_id', false, true);
Schema::create('category_transaction', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('category_id', false, true);
$table->integer('transaction_id', false, true);
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
}
);
$table->foreign('category_id')->references('id')->on('categories')->onDelete('cascade');
$table->foreign('transaction_id')->references('id')->on('transactions')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'category_transaction', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);

View File

@@ -33,12 +33,16 @@ class ChangesFor3101 extends Migration
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
/**
* Run the migrations.
*
* @SuppressWarnings("PHPMD.ShortMethodName")
*/
public function up(): void {}
public function up(): void
{
}
}

View File

@@ -39,7 +39,9 @@ class FixNullables extends Migration
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
/**
* Run the migrations.
@@ -50,12 +52,9 @@ class FixNullables extends Migration
{
if (!Schema::hasColumn('rule_groups', 'description')) {
try {
Schema::table(
'rule_groups',
static function (Blueprint $table): void {
$table->text('description')->nullable()->change();
}
);
Schema::table('rule_groups', static function (Blueprint $table): void {
$table->text('description')->nullable()->change();
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_UPDATE_ERROR, 'rule_groups', $e->getMessage()));
app('log')->error(self::COLUMN_ALREADY_EXISTS);
@@ -64,12 +63,9 @@ class FixNullables extends Migration
if (!Schema::hasColumn('rules', 'description')) {
try {
Schema::table(
'rules',
static function (Blueprint $table): void {
$table->text('description')->nullable()->change();
}
);
Schema::table('rules', static function (Blueprint $table): void {
$table->text('description')->nullable()->change();
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_UPDATE_ERROR, 'rules', $e->getMessage()));
app('log')->error(self::COLUMN_ALREADY_EXISTS);

View File

@@ -40,12 +40,9 @@ class ExpandTransactionsTable extends Migration
{
if (Schema::hasColumn('transactions', 'identifier')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->dropColumn('identifier');
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->dropColumn('identifier');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop column "identifier": %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -62,12 +59,9 @@ class ExpandTransactionsTable extends Migration
{
if (!Schema::hasColumn('transactions', 'identifier')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->smallInteger('identifier', false, true)->default(0);
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->smallInteger('identifier', false, true)->default(0);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -50,21 +50,20 @@ class ChangesForV410 extends Migration
{
if (!Schema::hasTable('notes')) {
try {
Schema::create(
'notes',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('noteable_id', false, true);
$table->string('noteable_type');
$table->string('title')->nullable();
$table->text('text')->nullable();
}
);
Schema::create('notes', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('noteable_id', false, true);
$table->string('noteable_type');
$table->string('title')->nullable();
$table->text('text')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "notes": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -40,12 +40,9 @@ class ChangesForV420 extends Migration
{
if (Schema::hasColumn('journal_meta', 'deleted_at')) {
try {
Schema::table(
'journal_meta',
static function (Blueprint $table): void {
$table->dropSoftDeletes();
}
);
Schema::table('journal_meta', static function (Blueprint $table): void {
$table->dropSoftDeletes();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -62,12 +59,9 @@ class ChangesForV420 extends Migration
{
if (!Schema::hasColumn('journal_meta', 'deleted_at')) {
try {
Schema::table(
'journal_meta',
static function (Blueprint $table): void {
$table->softDeletes();
}
);
Schema::table('journal_meta', static function (Blueprint $table): void {
$table->softDeletes();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -50,25 +50,24 @@ class ChangesForV430 extends Migration
{
if (!Schema::hasTable('available_budgets')) {
try {
Schema::create(
'available_budgets',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('transaction_currency_id', false, true);
$table->decimal('amount', 32, 12);
$table->date('start_date');
$table->date('end_date');
Schema::create('available_budgets', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('transaction_currency_id', false, true);
$table->decimal('amount', 32, 12);
$table->date('start_date');
$table->date('end_date');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "available_budgets": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -41,12 +41,9 @@ class ChangesForV431 extends Migration
// reinstate "repeats" and "repeat_freq".
if (!Schema::hasColumn('budget_limits', 'repeat_freq')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->string('repeat_freq', 30)->nullable();
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->string('repeat_freq', 30)->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -54,12 +51,9 @@ class ChangesForV431 extends Migration
}
if (!Schema::hasColumn('budget_limits', 'repeats')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->boolean('repeats')->default(0);
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->boolean('repeats')->default(0);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -68,12 +62,9 @@ class ChangesForV431 extends Migration
// change field "start_date" to "startdate"
if (Schema::hasColumn('budget_limits', 'start_date') && !Schema::hasColumn('budget_limits', 'startdate')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->renameColumn('start_date', 'startdate');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->renameColumn('start_date', 'startdate');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -83,12 +74,9 @@ class ChangesForV431 extends Migration
// remove date field "end_date"
if (Schema::hasColumn('budget_limits', 'end_date')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->dropColumn('end_date');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->dropColumn('end_date');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -97,12 +85,9 @@ class ChangesForV431 extends Migration
// remove decimal places
if (Schema::hasColumn('transaction_currencies', 'decimal_places')) {
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table): void {
$table->dropColumn('decimal_places');
}
);
Schema::table('transaction_currencies', static function (Blueprint $table): void {
$table->dropColumn('decimal_places');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -120,12 +105,9 @@ class ChangesForV431 extends Migration
// add decimal places to "transaction currencies".
if (!Schema::hasColumn('transaction_currencies', 'decimal_places')) {
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table): void {
$table->smallInteger('decimal_places', false, true)->default(2);
}
);
Schema::table('transaction_currencies', static function (Blueprint $table): void {
$table->smallInteger('decimal_places', false, true)->default(2);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -135,12 +117,9 @@ class ChangesForV431 extends Migration
// change field "startdate" to "start_date"
if (Schema::hasColumn('budget_limits', 'startdate') && !Schema::hasColumn('budget_limits', 'start_date')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->renameColumn('startdate', 'start_date');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->renameColumn('startdate', 'start_date');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -150,12 +129,9 @@ class ChangesForV431 extends Migration
// add date field "end_date" after "start_date"
if (!Schema::hasColumn('budget_limits', 'end_date')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->date('end_date')->nullable()->after('start_date');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->date('end_date')->nullable()->after('start_date');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -165,12 +141,9 @@ class ChangesForV431 extends Migration
// drop "repeats" and "repeat_freq".
if (Schema::hasColumn('budget_limits', 'repeats')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->dropColumn('repeats');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->dropColumn('repeats');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -178,12 +151,9 @@ class ChangesForV431 extends Migration
}
if (Schema::hasColumn('budget_limits', 'repeat_freq')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->dropColumn('repeat_freq');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->dropColumn('repeat_freq');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -41,18 +41,15 @@ class ChangesForV440 extends Migration
Schema::dropIfExists('currency_exchange_rates');
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'transaction_currency_id')) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('transactions_transaction_currency_id_foreign');
}
$table->dropColumn('transaction_currency_id');
Schema::table('transactions', static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'transaction_currency_id')) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('transactions_transaction_currency_id_foreign');
}
$table->dropColumn('transaction_currency_id');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -68,40 +65,36 @@ class ChangesForV440 extends Migration
{
if (!Schema::hasTable('currency_exchange_rates')) {
try {
Schema::create(
'currency_exchange_rates',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('from_currency_id', false, true);
$table->integer('to_currency_id', false, true);
$table->date('date');
$table->decimal('rate', 32, 12);
$table->decimal('user_rate', 32, 12)->nullable();
Schema::create('currency_exchange_rates', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('from_currency_id', false, true);
$table->integer('to_currency_id', false, true);
$table->date('date');
$table->decimal('rate', 32, 12);
$table->decimal('user_rate', 32, 12)->nullable();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('from_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('to_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
}
);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('from_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('to_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "notifications": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasColumn('transactions', 'transaction_currency_id')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'transaction_currency_id')) {
$table->integer('transaction_currency_id', false, true)->after('description')->nullable();
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
}
Schema::table('transactions', static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'transaction_currency_id')) {
$table->integer('transaction_currency_id', false, true)->after('description')->nullable();
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -41,12 +41,9 @@ class ChangesForV450 extends Migration
// split up for sqlite compatibility
if (Schema::hasColumn('transactions', 'foreign_amount')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->dropColumn('foreign_amount');
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->dropColumn('foreign_amount');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -54,27 +51,21 @@ class ChangesForV450 extends Migration
}
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('transactions_foreign_currency_id_foreign');
}
Schema::table('transactions', static function (Blueprint $table): void {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('transactions_foreign_currency_id_foreign');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
if (Schema::hasColumn('transactions', 'foreign_currency_id')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->dropColumn('foreign_currency_id');
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->dropColumn('foreign_currency_id');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -92,12 +83,9 @@ class ChangesForV450 extends Migration
// add "foreign_amount" to transactions
if (!Schema::hasColumn('transactions', 'foreign_amount')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->decimal('foreign_amount', 32, 12)->nullable()->after('amount');
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->decimal('foreign_amount', 32, 12)->nullable()->after('amount');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -107,13 +95,10 @@ class ChangesForV450 extends Migration
// add foreign transaction currency id to transactions (is nullable):
if (!Schema::hasColumn('transactions', 'foreign_currency_id')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->integer('foreign_currency_id', false, true)->default(null)->after('foreign_amount')->nullable();
$table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->integer('foreign_currency_id', false, true)->default(null)->after('foreign_amount')->nullable();
$table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -51,48 +51,46 @@ class ChangesForV470 extends Migration
{
if (!Schema::hasTable('link_types')) {
try {
Schema::create(
'link_types',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('name');
$table->string('outward');
$table->string('inward');
$table->boolean('editable');
Schema::create('link_types', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('name');
$table->string('outward');
$table->string('inward');
$table->boolean('editable');
$table->unique(['name', 'outward', 'inward']);
}
);
$table->unique(['name', 'outward', 'inward']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "link_types": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('journal_links')) {
try {
Schema::create(
'journal_links',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('link_type_id', false, true);
$table->integer('source_id', false, true);
$table->integer('destination_id', false, true);
$table->text('comment')->nullable();
Schema::create('journal_links', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->integer('link_type_id', false, true);
$table->integer('source_id', false, true);
$table->integer('destination_id', false, true);
$table->text('comment')->nullable();
$table->foreign('link_type_id')->references('id')->on('link_types')->onDelete('cascade');
$table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade');
$table->foreign('destination_id')->references('id')->on('transaction_journals')->onDelete('cascade');
$table->foreign('link_type_id')->references('id')->on('link_types')->onDelete('cascade');
$table->foreign('source_id')->references('id')->on('transaction_journals')->onDelete('cascade');
$table->foreign('destination_id')->references('id')->on('transaction_journals')->onDelete('cascade');
$table->unique(['link_type_id', 'source_id', 'destination_id']);
}
);
$table->unique(['link_type_id', 'source_id', 'destination_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "journal_links": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -40,12 +40,9 @@ class ChangesForV470a extends Migration
{
if (Schema::hasColumn('transactions', 'reconciled')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->dropColumn('reconciled');
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->dropColumn('reconciled');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -62,12 +59,9 @@ class ChangesForV470a extends Migration
{
if (!Schema::hasColumn('transactions', 'reconciled')) {
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
$table->boolean('reconciled')->after('deleted_at')->default(0);
}
);
Schema::table('transactions', static function (Blueprint $table): void {
$table->boolean('reconciled')->after('deleted_at')->default(0);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -51,20 +51,19 @@ class CreateOauthAuthCodesTable extends Migration
{
if (!Schema::hasTable('oauth_auth_codes')) {
try {
Schema::create(
'oauth_auth_codes',
static function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->integer('user_id');
$table->integer('client_id');
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
}
);
Schema::create('oauth_auth_codes', static function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->integer('user_id');
$table->integer('client_id');
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "oauth_auth_codes": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -51,22 +51,21 @@ class CreateOauthAccessTokensTable extends Migration
{
if (!Schema::hasTable('oauth_access_tokens')) {
try {
Schema::create(
'oauth_access_tokens',
static function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->integer('user_id')->index()->nullable();
$table->integer('client_id');
$table->string('name')->nullable();
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->timestamps();
$table->dateTime('expires_at')->nullable();
}
);
Schema::create('oauth_access_tokens', static function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->integer('user_id')->index()->nullable();
$table->integer('client_id');
$table->string('name')->nullable();
$table->text('scopes')->nullable();
$table->boolean('revoked');
$table->timestamps();
$table->dateTime('expires_at')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "oauth_access_tokens": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -51,18 +51,17 @@ class CreateOauthRefreshTokensTable extends Migration
{
if (!Schema::hasTable('oauth_refresh_tokens')) {
try {
Schema::create(
'oauth_refresh_tokens',
static function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
}
);
Schema::create('oauth_refresh_tokens', static function (Blueprint $table): void {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "oauth_refresh_tokens": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -51,23 +51,22 @@ class CreateOauthClientsTable extends Migration
{
if (!Schema::hasTable('oauth_clients')) {
try {
Schema::create(
'oauth_clients',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('user_id')->index()->nullable();
$table->string('name');
$table->string('secret', 100);
$table->text('redirect');
$table->boolean('personal_access_client');
$table->boolean('password_client');
$table->boolean('revoked');
$table->timestamps();
}
);
Schema::create('oauth_clients', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('user_id')->index()->nullable();
$table->string('name');
$table->string('secret', 100);
$table->text('redirect');
$table->boolean('personal_access_client');
$table->boolean('password_client');
$table->boolean('revoked');
$table->timestamps();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "oauth_clients": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -51,17 +51,16 @@ class CreateOauthPersonalAccessClientsTable extends Migration
{
if (!Schema::hasTable('oauth_personal_access_clients')) {
try {
Schema::create(
'oauth_personal_access_clients',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('client_id')->index();
$table->timestamps();
}
);
Schema::create('oauth_personal_access_clients', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('client_id')->index();
$table->timestamps();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "oauth_personal_access_clients": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -41,12 +41,9 @@ class ChangesForV472 extends Migration
{
if (!Schema::hasColumn('attachments', 'notes')) {
try {
Schema::table(
'attachments',
static function (Blueprint $table): void {
$table->text('notes')->nullable();
}
);
Schema::table('attachments', static function (Blueprint $table): void {
$table->text('notes')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -55,12 +52,9 @@ class ChangesForV472 extends Migration
if (Schema::hasColumn('transactions', 'order')) {
try {
Schema::table(
'budgets',
static function (Blueprint $table): void {
$table->dropColumn('order');
}
);
Schema::table('budgets', static function (Blueprint $table): void {
$table->dropColumn('order');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -77,12 +71,9 @@ class ChangesForV472 extends Migration
{
if (Schema::hasColumn('attachments', 'notes')) {
try {
Schema::table(
'attachments',
static function (Blueprint $table): void {
$table->dropColumn('notes');
}
);
Schema::table('attachments', static function (Blueprint $table): void {
$table->dropColumn('notes');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -91,12 +82,9 @@ class ChangesForV472 extends Migration
if (!Schema::hasColumn('budgets', 'order')) {
try {
Schema::table(
'budgets',
static function (Blueprint $table): void {
$table->mediumInteger('order', false, true)->default(0);
}
);
Schema::table('budgets', static function (Blueprint $table): void {
$table->mediumInteger('order', false, true)->default(0);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -41,16 +41,13 @@ class ChangesForV473 extends Migration
{
if (!Schema::hasColumn('bills', 'transaction_currency_id')) {
try {
Schema::table(
'bills',
static function (Blueprint $table): void {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('bills_transaction_currency_id_foreign');
}
$table->dropColumn('transaction_currency_id');
Schema::table('bills', static function (Blueprint $table): void {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('bills_transaction_currency_id_foreign');
}
);
$table->dropColumn('transaction_currency_id');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -59,12 +56,9 @@ class ChangesForV473 extends Migration
if (!Schema::hasColumn('rules', 'strict')) {
try {
Schema::table(
'rules',
static function (Blueprint $table): void {
$table->dropColumn('strict');
}
);
Schema::table('rules', static function (Blueprint $table): void {
$table->dropColumn('strict');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -81,13 +75,10 @@ class ChangesForV473 extends Migration
{
if (!Schema::hasColumn('bills', 'transaction_currency_id')) {
try {
Schema::table(
'bills',
static function (Blueprint $table): void {
$table->integer('transaction_currency_id', false, true)->nullable()->after('user_id');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
}
);
Schema::table('bills', static function (Blueprint $table): void {
$table->integer('transaction_currency_id', false, true)->nullable()->after('user_id');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -95,12 +86,9 @@ class ChangesForV473 extends Migration
}
if (!Schema::hasColumn('rules', 'strict')) {
try {
Schema::table(
'rules',
static function (Blueprint $table): void {
$table->boolean('strict')->default(true);
}
);
Schema::table('rules', static function (Blueprint $table): void {
$table->boolean('strict')->default(true);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -34,12 +34,16 @@ class ChangesForV474 extends Migration
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
/**
* Run the migrations.
*
* @SuppressWarnings("PHPMD.ShortMethodName")
*/
public function up(): void {}
public function up(): void
{
}
}

View File

@@ -56,130 +56,125 @@ class ChangesForV475 extends Migration
{
if (!Schema::hasTable('recurrences')) {
try {
Schema::create(
'recurrences',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('transaction_type_id', false, true);
Schema::create('recurrences', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('transaction_type_id', false, true);
$table->string('title', 1024);
$table->text('description');
$table->string('title', 1024);
$table->text('description');
$table->date('first_date');
$table->date('repeat_until')->nullable();
$table->date('latest_date')->nullable();
$table->smallInteger('repetitions', false, true);
$table->date('first_date');
$table->date('repeat_until')->nullable();
$table->date('latest_date')->nullable();
$table->smallInteger('repetitions', false, true);
$table->boolean('apply_rules')->default(true);
$table->boolean('active')->default(true);
$table->boolean('apply_rules')->default(true);
$table->boolean('active')->default(true);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
}
);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('transaction_type_id')->references('id')->on('transaction_types')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "recurrences": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('recurrences_transactions')) {
try {
Schema::create(
'recurrences_transactions',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('recurrence_id', false, true);
$table->integer('transaction_currency_id', false, true);
$table->integer('foreign_currency_id', false, true)->nullable();
$table->integer('source_id', false, true);
$table->integer('destination_id', false, true);
Schema::create('recurrences_transactions', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('recurrence_id', false, true);
$table->integer('transaction_currency_id', false, true);
$table->integer('foreign_currency_id', false, true)->nullable();
$table->integer('source_id', false, true);
$table->integer('destination_id', false, true);
$table->decimal('amount', 32, 12);
$table->decimal('foreign_amount', 32, 12)->nullable();
$table->string('description', 1024);
$table->decimal('amount', 32, 12);
$table->decimal('foreign_amount', 32, 12)->nullable();
$table->string('description', 1024);
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
$table->foreign('source_id')->references('id')->on('accounts')->onDelete('cascade');
$table->foreign('destination_id')->references('id')->on('accounts')->onDelete('cascade');
}
);
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('foreign_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
$table->foreign('source_id')->references('id')->on('accounts')->onDelete('cascade');
$table->foreign('destination_id')->references('id')->on('accounts')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "recurrences_transactions": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('recurrences_repetitions')) {
try {
Schema::create(
'recurrences_repetitions',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('recurrence_id', false, true);
$table->string('repetition_type', 50);
$table->string('repetition_moment', 50);
$table->smallInteger('repetition_skip', false, true);
$table->smallInteger('weekend', false, true);
Schema::create('recurrences_repetitions', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('recurrence_id', false, true);
$table->string('repetition_type', 50);
$table->string('repetition_moment', 50);
$table->smallInteger('repetition_skip', false, true);
$table->smallInteger('weekend', false, true);
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
}
);
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "recurrences_repetitions": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('recurrences_meta')) {
try {
Schema::create(
'recurrences_meta',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('recurrence_id', false, true);
Schema::create('recurrences_meta', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('recurrence_id', false, true);
$table->string('name', 50);
$table->text('value');
$table->string('name', 50);
$table->text('value');
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
}
);
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "recurrences_meta": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('rt_meta')) {
try {
Schema::create(
'rt_meta',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('rt_id', false, true);
Schema::create('rt_meta', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('rt_id', false, true);
$table->string('name', 50);
$table->text('value');
$table->string('name', 50);
$table->text('value');
$table->foreign('rt_id')->references('id')->on('recurrences_transactions')->onDelete('cascade');
}
);
$table->foreign('rt_id')->references('id')->on('recurrences_transactions')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "rt_meta": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -41,17 +41,14 @@ class ChangesForV477 extends Migration
{
if (Schema::hasColumn('budget_limits', 'transaction_currency_id')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('budget_limits_transaction_currency_id_foreign');
}
$table->dropColumn(['transaction_currency_id']);
Schema::table('budget_limits', static function (Blueprint $table): void {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('budget_limits_transaction_currency_id_foreign');
}
);
$table->dropColumn(['transaction_currency_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -68,13 +65,10 @@ class ChangesForV477 extends Migration
{
if (!Schema::hasColumn('budget_limits', 'transaction_currency_id')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->integer('transaction_currency_id', false, true)->nullable()->after('budget_id');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->integer('transaction_currency_id', false, true)->nullable()->after('budget_id');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -41,12 +41,9 @@ class ChangesForV479 extends Migration
{
if (Schema::hasColumn('transaction_currencies', 'enabled')) {
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table): void {
$table->dropColumn(['enabled']);
}
);
Schema::table('transaction_currencies', static function (Blueprint $table): void {
$table->dropColumn(['enabled']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -63,12 +60,9 @@ class ChangesForV479 extends Migration
{
if (!Schema::hasColumn('transaction_currencies', 'enabled')) {
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table): void {
$table->boolean('enabled')->default(0)->after('deleted_at');
}
);
Schema::table('transaction_currencies', static function (Blueprint $table): void {
$table->boolean('enabled')->default(0)->after('deleted_at');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -52,43 +52,41 @@ class ChangesForV4710 extends Migration
{
if (!Schema::hasTable('transaction_groups')) {
try {
Schema::create(
'transaction_groups',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('title', 1024)->nullable();
Schema::create('transaction_groups', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('title', 1024)->nullable();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "transaction_groups": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('group_journals')) {
try {
Schema::create(
'group_journals',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('transaction_group_id', false, true);
$table->integer('transaction_journal_id', false, true);
Schema::create('group_journals', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('transaction_group_id', false, true);
$table->integer('transaction_journal_id', false, true);
$table->foreign('transaction_group_id')->references('id')->on('transaction_groups')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
$table->foreign('transaction_group_id')->references('id')->on('transaction_groups')->onDelete('cascade');
$table->foreign('transaction_journal_id')->references('id')->on('transaction_journals')->onDelete('cascade');
// unique combi:
$table->unique(['transaction_group_id', 'transaction_journal_id'], 'unique_in_group');
}
);
// unique combi:
$table->unique(['transaction_group_id', 'transaction_journal_id'], 'unique_in_group');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "group_journals": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -37,7 +37,9 @@ class ChangesForV4711 extends Migration
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
/**
* Run the migrations.
@@ -55,24 +57,18 @@ class ChangesForV4711 extends Migration
* nice.
*/
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table): void {
$table->dateTime('date')->change();
}
);
Schema::table('transaction_journals', static function (Blueprint $table): void {
$table->dateTime('date')->change();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
try {
Schema::table(
'preferences',
static function (Blueprint $table): void {
$table->text('data')->nullable()->change();
}
);
Schema::table('preferences', static function (Blueprint $table): void {
$table->text('data')->nullable()->change();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -37,7 +37,9 @@ class ChangesForV4712 extends Migration
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
/**
* Run the migrations.
@@ -55,12 +57,9 @@ class ChangesForV4712 extends Migration
* nice.
*/
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table): void {
$table->dateTime('date')->change();
}
);
Schema::table('transaction_journals', static function (Blueprint $table): void {
$table->dateTime('date')->change();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -41,12 +41,9 @@ class FixLdapConfiguration extends Migration
{
if (Schema::hasColumn('users', 'objectguid')) {
try {
Schema::table(
'users',
static function (Blueprint $table): void {
$table->dropColumn(['objectguid']);
}
);
Schema::table('users', static function (Blueprint $table): void {
$table->dropColumn(['objectguid']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -67,12 +64,9 @@ class FixLdapConfiguration extends Migration
*/
if (!Schema::hasColumn('users', 'objectguid')) {
try {
Schema::table(
'users',
static function (Blueprint $table): void {
$table->uuid('objectguid')->nullable()->after('id');
}
);
Schema::table('users', static function (Blueprint $table): void {
$table->uuid('objectguid')->nullable()->after('id');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -42,28 +42,27 @@ class ChangesForV480 extends Migration
// remove group ID
if (Schema::hasColumn('transaction_journals', 'transaction_group_id')) {
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table): void {
// drop transaction_group_id + foreign key.
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
try {
$table->dropForeign('transaction_journals_transaction_group_id_foreign');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop foreign ID: %s', $e->getMessage()));
app('log')->error('If the foreign ID does not exist (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
Schema::table('transaction_journals', static function (Blueprint $table): void {
// drop transaction_group_id + foreign key.
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
try {
$table->dropColumn('transaction_group_id');
$table->dropForeign('transaction_journals_transaction_group_id_foreign');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
app('log')->error(sprintf('Could not drop foreign ID: %s', $e->getMessage()));
app('log')->error(
'If the foreign ID does not exist (see error), this is not an problem. Otherwise, please open a GitHub discussion.'
);
}
}
);
try {
$table->dropColumn('transaction_group_id');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -73,17 +72,14 @@ class ChangesForV480 extends Migration
// remove 'stop processing' column
if (Schema::hasColumn('rule_groups', 'stop_processing')) {
try {
Schema::table(
'rule_groups',
static function (Blueprint $table): void {
try {
$table->dropColumn('stop_processing');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table('rule_groups', static function (Blueprint $table): void {
try {
$table->dropColumn('stop_processing');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -93,17 +89,14 @@ class ChangesForV480 extends Migration
// remove 'mfa_secret' column
if (Schema::hasColumn('users', 'mfa_secret')) {
try {
Schema::table(
'users',
static function (Blueprint $table): void {
try {
$table->dropColumn('mfa_secret');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table('users', static function (Blueprint $table): void {
try {
$table->dropColumn('mfa_secret');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -121,27 +114,22 @@ class ChangesForV480 extends Migration
// add currency_id
if (!Schema::hasColumn('transaction_journals', 'transaction_group_id')) {
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table): void {
$table->integer('transaction_currency_id', false, true)->nullable()->change();
Schema::table('transaction_journals', static function (Blueprint $table): void {
$table->integer('transaction_currency_id', false, true)->nullable()->change();
// add column "group_id" after "transaction_type_id"
$table->integer('transaction_group_id', false, true)
->nullable()->default(null)->after('transaction_type_id')
;
// add column "group_id" after "transaction_type_id"
$table->integer('transaction_group_id', false, true)->nullable()->default(null)->after('transaction_type_id');
// add foreign key for "transaction_group_id"
try {
$table->foreign('transaction_group_id')->references('id')->on('transaction_groups')->onDelete('cascade');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create foreign index: %s', $e->getMessage()));
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
// add foreign key for "transaction_group_id"
try {
$table->foreign('transaction_group_id')->references('id')->on('transaction_groups')->onDelete('cascade');
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create foreign index: %s', $e->getMessage()));
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -151,12 +139,9 @@ class ChangesForV480 extends Migration
// add 'stop processing' column
if (!Schema::hasColumn('rule_groups', 'stop_processing')) {
try {
Schema::table(
'rule_groups',
static function (Blueprint $table): void {
$table->boolean('stop_processing')->default(false);
}
);
Schema::table('rule_groups', static function (Blueprint $table): void {
$table->boolean('stop_processing')->default(false);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -166,12 +151,9 @@ class ChangesForV480 extends Migration
// add 'mfa_secret' column
if (!Schema::hasColumn('users', 'mfa_secret')) {
try {
Schema::table(
'users',
static function (Blueprint $table): void {
$table->string('mfa_secret', 50)->nullable();
}
);
Schema::table('users', static function (Blueprint $table): void {
$table->string('mfa_secret', 50)->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -51,24 +51,23 @@ class MakeLocationsTable extends Migration
{
if (!Schema::hasTable('locations')) {
try {
Schema::create(
'locations',
static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
Schema::create('locations', static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->integer('locatable_id', false, true);
$table->string('locatable_type', 255);
$table->integer('locatable_id', false, true);
$table->string('locatable_type', 255);
$table->decimal('latitude', 12, 8)->nullable();
$table->decimal('longitude', 12, 8)->nullable();
$table->smallInteger('zoom_level', false, true)->nullable();
}
);
$table->decimal('latitude', 12, 8)->nullable();
$table->decimal('longitude', 12, 8)->nullable();
$table->smallInteger('zoom_level', false, true)->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "locations": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -52,25 +52,24 @@ class ChangesForV520 extends Migration
{
if (!Schema::hasTable('auto_budgets')) {
try {
Schema::create(
'auto_budgets',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('budget_id', false, true);
$table->integer('transaction_currency_id', false, true);
$table->tinyInteger('auto_budget_type', false, true)->default(1);
$table->decimal('amount', 32, 12);
$table->string('period', 50);
Schema::create('auto_budgets', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('budget_id', false, true);
$table->integer('transaction_currency_id', false, true);
$table->tinyInteger('auto_budget_type', false, true)->default(1);
$table->decimal('amount', 32, 12);
$table->string('period', 50);
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
}
);
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('cascade');
$table->foreign('budget_id')->references('id')->on('budgets')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "auto_budgets": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -52,37 +52,35 @@ class ChangesForV530 extends Migration
{
if (!Schema::hasTable('object_groups')) {
try {
Schema::create(
'object_groups',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('user_id', false, true);
$table->timestamps();
$table->softDeletes();
$table->string('title', 255);
$table->mediumInteger('order', false, true)->default(0);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
Schema::create('object_groups', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('user_id', false, true);
$table->timestamps();
$table->softDeletes();
$table->string('title', 255);
$table->mediumInteger('order', false, true)->default(0);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "object_groups": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('object_groupables')) {
try {
Schema::create(
'object_groupables',
static function (Blueprint $table): void {
$table->integer('object_group_id');
$table->integer('object_groupable_id', false, true);
$table->string('object_groupable_type', 255);
}
);
Schema::create('object_groupables', static function (Blueprint $table): void {
$table->integer('object_group_id');
$table->integer('object_groupable_id', false, true);
$table->string('object_groupable_type', 255);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "object_groupables": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -41,12 +41,9 @@ class ChangesForV530a extends Migration
{
if (Schema::hasColumn('bills', 'order')) {
try {
Schema::table(
'bills',
static function (Blueprint $table): void {
$table->dropColumn('order');
}
);
Schema::table('bills', static function (Blueprint $table): void {
$table->dropColumn('order');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -63,12 +60,9 @@ class ChangesForV530a extends Migration
{
if (!Schema::hasColumn('bills', 'order')) {
try {
Schema::table(
'bills',
static function (Blueprint $table): void {
$table->integer('order', false, true)->default(0);
}
);
Schema::table('bills', static function (Blueprint $table): void {
$table->integer('order', false, true)->default(0);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -41,12 +41,9 @@ class ChangesForV540 extends Migration
{
if (Schema::hasColumn('oauth_clients', 'provider')) {
try {
Schema::table(
'oauth_clients',
static function (Blueprint $table): void {
$table->dropColumn('provider');
}
);
Schema::table('oauth_clients', static function (Blueprint $table): void {
$table->dropColumn('provider');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -55,12 +52,9 @@ class ChangesForV540 extends Migration
if (Schema::hasColumn('accounts', 'order')) {
try {
Schema::table(
'accounts',
static function (Blueprint $table): void {
$table->dropColumn('order');
}
);
Schema::table('accounts', static function (Blueprint $table): void {
$table->dropColumn('order');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -69,12 +63,9 @@ class ChangesForV540 extends Migration
// in two steps for sqlite
if (Schema::hasColumn('bills', 'end_date')) {
try {
Schema::table(
'bills',
static function (Blueprint $table): void {
$table->dropColumn('end_date');
}
);
Schema::table('bills', static function (Blueprint $table): void {
$table->dropColumn('end_date');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -82,12 +73,9 @@ class ChangesForV540 extends Migration
}
if (Schema::hasColumn('bills', 'extension_date')) {
try {
Schema::table(
'bills',
static function (Blueprint $table): void {
$table->dropColumn('extension_date');
}
);
Schema::table('bills', static function (Blueprint $table): void {
$table->dropColumn('extension_date');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -104,12 +92,9 @@ class ChangesForV540 extends Migration
{
if (!Schema::hasColumn('accounts', 'order')) {
try {
Schema::table(
'accounts',
static function (Blueprint $table): void {
$table->integer('order', false, true)->default(0);
}
);
Schema::table('accounts', static function (Blueprint $table): void {
$table->integer('order', false, true)->default(0);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -118,12 +103,9 @@ class ChangesForV540 extends Migration
if (!Schema::hasColumn('oauth_clients', 'provider')) {
try {
Schema::table(
'oauth_clients',
static function (Blueprint $table): void {
$table->string('provider')->nullable();
}
);
Schema::table('oauth_clients', static function (Blueprint $table): void {
$table->string('provider')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -132,13 +114,10 @@ class ChangesForV540 extends Migration
if (!Schema::hasColumn('bills', 'end_date') && !Schema::hasColumn('bills', 'extension_date')) {
try {
Schema::table(
'bills',
static function (Blueprint $table): void {
$table->date('end_date')->nullable()->after('date');
$table->date('extension_date')->nullable()->after('end_date');
}
);
Schema::table('bills', static function (Blueprint $table): void {
$table->date('end_date')->nullable()->after('date');
$table->date('extension_date')->nullable()->after('end_date');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -147,12 +126,9 @@ class ChangesForV540 extends Migration
// make column nullable:
try {
Schema::table(
'oauth_clients',
static function (Blueprint $table): void {
$table->string('secret', 100)->nullable()->change();
}
);
Schema::table('oauth_clients', static function (Blueprint $table): void {
$table->string('secret', 100)->nullable()->change();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -42,39 +42,35 @@ class ChangesForV550 extends Migration
if (!Schema::hasTable('jobs')) {
try {
Schema::create(
'jobs',
static function (Blueprint $table): void {
// straight from Laravel (this is the OLD table)
$table->bigIncrements('id');
$table->string('queue');
$table->longText('payload');
$table->tinyInteger('attempts')->unsigned();
$table->tinyInteger('reserved')->unsigned();
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
$table->index(['queue', 'reserved', 'reserved_at']);
}
);
Schema::create('jobs', static function (Blueprint $table): void {
// straight from Laravel (this is the OLD table)
$table->bigIncrements('id');
$table->string('queue');
$table->longText('payload');
$table->tinyInteger('attempts')->unsigned();
$table->tinyInteger('reserved')->unsigned();
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
$table->index(['queue', 'reserved', 'reserved_at']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "jobs": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
// expand budget / transaction journal table.
if (Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
try {
Schema::table(
'budget_transaction_journal',
static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('budget_id_foreign');
}
$table->dropColumn('budget_limit_id');
Schema::table('budget_transaction_journal', static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('budget_id_foreign');
}
);
$table->dropColumn('budget_limit_id');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -88,12 +84,9 @@ class ChangesForV550 extends Migration
// in two steps for sqlite
if (Schema::hasColumn('budget_limits', 'period')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->dropColumn('period');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->dropColumn('period');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -101,12 +94,9 @@ class ChangesForV550 extends Migration
}
if (Schema::hasColumn('budget_limits', 'generated')) {
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
$table->dropColumn('generated');
}
);
Schema::table('budget_limits', static function (Blueprint $table): void {
$table->dropColumn('generated');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -133,21 +123,20 @@ class ChangesForV550 extends Migration
// this is the NEW table
if (!Schema::hasTable('jobs')) {
try {
Schema::create(
'jobs',
static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
}
);
Schema::create('jobs', static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "jobs": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
// drop failed jobs table.
@@ -156,36 +145,32 @@ class ChangesForV550 extends Migration
// create new failed_jobs table.
if (!Schema::hasTable('failed_jobs')) {
try {
Schema::create(
'failed_jobs',
static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
}
);
Schema::create('failed_jobs', static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "failed_jobs": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
// update budget / transaction journal table.
if (!Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
try {
Schema::table(
'budget_transaction_journal',
static function (Blueprint $table): void {
if (!Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
$table->integer('budget_limit_id', false, true)->nullable()->default(null)->after('budget_id');
$table->foreign('budget_limit_id', 'budget_id_foreign')->references('id')->on('budget_limits')->onDelete('set null');
}
Schema::table('budget_transaction_journal', static function (Blueprint $table): void {
if (!Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
$table->integer('budget_limit_id', false, true)->nullable()->default(null)->after('budget_id');
$table->foreign('budget_limit_id', 'budget_id_foreign')->references('id')->on('budget_limits')->onDelete('set null');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -196,17 +181,14 @@ class ChangesForV550 extends Migration
// I swear I dropped & recreated this field 15 times already.
try {
Schema::table(
'budget_limits',
static function (Blueprint $table): void {
if (!Schema::hasColumn('budget_limits', 'period')) {
$table->string('period', 12)->nullable();
}
if (!Schema::hasColumn('budget_limits', 'generated')) {
$table->boolean('generated')->default(false);
}
Schema::table('budget_limits', static function (Blueprint $table): void {
if (!Schema::hasColumn('budget_limits', 'period')) {
$table->string('period', 12)->nullable();
}
);
if (!Schema::hasColumn('budget_limits', 'generated')) {
$table->boolean('generated')->default(false);
}
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -215,74 +197,71 @@ class ChangesForV550 extends Migration
// new webhooks table
if (!Schema::hasTable('webhooks')) {
try {
Schema::create(
'webhooks',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('title', 255)->index();
$table->string('secret', 32)->index();
$table->boolean('active')->default(true);
$table->unsignedSmallInteger('trigger');
$table->unsignedSmallInteger('response');
$table->unsignedSmallInteger('delivery');
$table->string('url', 1024);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
}
);
Schema::create('webhooks', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('title', 255)->index();
$table->string('secret', 32)->index();
$table->boolean('active')->default(true);
$table->unsignedSmallInteger('trigger');
$table->unsignedSmallInteger('response');
$table->unsignedSmallInteger('delivery');
$table->string('url', 1024);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "webhooks": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
// new webhook_messages table
if (!Schema::hasTable('webhook_messages')) {
try {
Schema::create(
'webhook_messages',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->boolean('sent')->default(false);
$table->boolean('errored')->default(false);
Schema::create('webhook_messages', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->boolean('sent')->default(false);
$table->boolean('errored')->default(false);
$table->integer('webhook_id', false, true);
$table->string('uuid', 64);
$table->longText('message');
$table->integer('webhook_id', false, true);
$table->string('uuid', 64);
$table->longText('message');
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
}
);
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "webhook_messages": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('webhook_attempts')) {
try {
Schema::create(
'webhook_attempts',
static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('webhook_message_id', false, true);
$table->unsignedSmallInteger('status_code')->default(0);
Schema::create('webhook_attempts', static function (Blueprint $table): void {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('webhook_message_id', false, true);
$table->unsignedSmallInteger('status_code')->default(0);
$table->longText('logs')->nullable();
$table->longText('response')->nullable();
$table->longText('logs')->nullable();
$table->longText('response')->nullable();
$table->foreign('webhook_message_id')->references('id')->on('webhook_messages')->onDelete('cascade');
}
);
$table->foreign('webhook_message_id')->references('id')->on('webhook_messages')->onDelete('cascade');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "webhook_attempts": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -39,17 +39,14 @@ class ChangesForV550b2 extends Migration
{
if (Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
try {
Schema::table(
'recurrences_transactions',
static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('type_foreign');
}
if (Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
$table->dropColumn('transaction_type_id');
}
Schema::table('recurrences_transactions', static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('type_foreign');
}
);
if (Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
$table->dropColumn('transaction_type_id');
}
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -67,15 +64,12 @@ class ChangesForV550b2 extends Migration
// expand recurrence transaction table
if (!Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
try {
Schema::table(
'recurrences_transactions',
static function (Blueprint $table): void {
if (!Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
$table->integer('transaction_type_id', false, true)->nullable()->after('transaction_currency_id');
$table->foreign('transaction_type_id', 'type_foreign')->references('id')->on('transaction_types')->onDelete('set null');
}
Schema::table('recurrences_transactions', static function (Blueprint $table): void {
if (!Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
$table->integer('transaction_type_id', false, true)->nullable()->after('transaction_currency_id');
$table->foreign('transaction_type_id', 'type_foreign')->references('id')->on('transaction_types')->onDelete('set null');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -36,12 +36,9 @@ class AddLdapColumnsToUsersTable extends Migration
{
if (Schema::hasColumn('users', 'domain')) {
try {
Schema::table(
'users',
static function (Blueprint $table): void {
$table->dropColumn(['domain']);
}
);
Schema::table('users', static function (Blueprint $table): void {
$table->dropColumn(['domain']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -58,12 +55,9 @@ class AddLdapColumnsToUsersTable extends Migration
{
if (!Schema::hasColumn('users', 'domain')) {
try {
Schema::table(
'users',
static function (Blueprint $table): void {
$table->string('domain')->nullable();
}
);
Schema::table('users', static function (Blueprint $table): void {
$table->string('domain')->nullable();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -35,7 +35,9 @@ class ExtendCurrencyInfo extends Migration
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
/**
* Run the migrations.
@@ -45,13 +47,10 @@ class ExtendCurrencyInfo extends Migration
public function up(): void
{
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table): void {
$table->string('code', 51)->change();
$table->string('symbol', 51)->change();
}
);
Schema::table('transaction_currencies', static function (Blueprint $table): void {
$table->string('code', 51)->change();
$table->string('symbol', 51)->change();
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -32,24 +32,23 @@ use Illuminate\Support\Facades\Schema;
*/
class UserGroups extends Migration
{
private array $tables
= [
'accounts',
'attachments',
'available_budgets',
'bills',
'budgets',
'categories',
'recurrences',
'object_groups',
'preferences',
'rule_groups',
'rules',
'tags',
'transaction_groups',
'transaction_journals',
'webhooks',
];
private array $tables = [
'accounts',
'attachments',
'available_budgets',
'bills',
'budgets',
'categories',
'recurrences',
'object_groups',
'preferences',
'rule_groups',
'rules',
'tags',
'transaction_groups',
'transaction_journals',
'webhooks'
];
/**
* Reverse the migrations.
@@ -61,17 +60,14 @@ class UserGroups extends Migration
foreach ($this->tables as $tableName) {
if (Schema::hasColumn($tableName, 'user_group_id')) {
try {
Schema::table(
$tableName,
static function (Blueprint $table) use ($tableName): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign(sprintf('%s_to_ugi', $tableName));
}
if (Schema::hasColumn($tableName, 'user_group_id')) {
$table->dropColumn('user_group_id');
}
Schema::table($tableName, static function (Blueprint $table) use ($tableName): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign(sprintf('%s_to_ugi', $tableName));
}
);
if (Schema::hasColumn($tableName, 'user_group_id')) {
$table->dropColumn('user_group_id');
}
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -81,17 +77,14 @@ class UserGroups extends Migration
if (Schema::hasColumn('users', 'user_group_id')) {
try {
Schema::table(
'users',
static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('type_user_group_id');
}
if (Schema::hasColumn('users', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
Schema::table('users', static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('type_user_group_id');
}
);
if (Schema::hasColumn('users', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -117,76 +110,68 @@ class UserGroups extends Migration
*/
if (!Schema::hasTable('user_groups')) {
try {
Schema::create(
'user_groups',
static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
Schema::create('user_groups', static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->string('title', 255);
$table->unique('title');
}
);
$table->string('title', 255);
$table->unique('title');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "user_groups": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('user_roles')) {
try {
Schema::create(
'user_roles',
static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
Schema::create('user_roles', static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->string('title', 255);
$table->unique('title');
}
);
$table->string('title', 255);
$table->unique('title');
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "user_roles": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
if (!Schema::hasTable('group_memberships')) {
try {
Schema::create(
'group_memberships',
static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->bigInteger('user_group_id', false, true);
$table->bigInteger('user_role_id', false, true);
Schema::create('group_memberships', static function (Blueprint $table): void {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->bigInteger('user_group_id', false, true);
$table->bigInteger('user_role_id', false, true);
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('user_group_id')->references('id')->on('user_groups')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('user_role_id')->references('id')->on('user_roles')->onUpdate('cascade')->onDelete('cascade');
$table->unique(['user_id', 'user_group_id', 'user_role_id']);
}
);
$table->foreign('user_id')->references('id')->on('users')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('user_group_id')->references('id')->on('user_groups')->onUpdate('cascade')->onDelete('cascade');
$table->foreign('user_role_id')->references('id')->on('user_roles')->onUpdate('cascade')->onDelete('cascade');
$table->unique(['user_id', 'user_group_id', 'user_role_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "group_memberships": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
try {
Schema::table(
'users',
static function (Blueprint $table): void {
if (!Schema::hasColumn('users', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable();
$table->foreign('user_group_id', 'type_user_group_id')->references('id')->on('user_groups')->onDelete('set null')->onUpdate(
'cascade'
);
}
Schema::table('users', static function (Blueprint $table): void {
if (!Schema::hasColumn('users', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable();
$table->foreign('user_group_id', 'type_user_group_id')->references('id')->on('user_groups')->onDelete('set null')->onUpdate('cascade');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -196,17 +181,17 @@ class UserGroups extends Migration
/** @var string $tableName */
foreach ($this->tables as $tableName) {
try {
Schema::table(
$tableName,
static function (Blueprint $table) use ($tableName): void {
if (!Schema::hasColumn($tableName, 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table->foreign('user_group_id', sprintf('%s_to_ugi', $tableName))->references('id')->on('user_groups')->onDelete(
'set null'
)->onUpdate('cascade');
}
Schema::table($tableName, static function (Blueprint $table) use ($tableName): void {
if (!Schema::hasColumn($tableName, 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table
->foreign('user_group_id', sprintf('%s_to_ugi', $tableName))
->references('id')
->on('user_groups')
->onDelete('set null')
->onUpdate('cascade');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -60,7 +60,9 @@ class CreateLocalPersonalAccessTokensTable extends Migration
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "personal_access_tokens": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -27,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*
@@ -36,15 +36,12 @@ return new class () extends Migration {
public function up(): void
{
try {
Schema::table(
'currency_exchange_rates',
static function (Blueprint $table): void {
if (!Schema::hasColumn('currency_exchange_rates', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table->foreign('user_group_id', 'cer_to_ugi')->references('id')->on('user_groups')->onDelete('set null')->onUpdate('cascade');
}
Schema::table('currency_exchange_rates', static function (Blueprint $table): void {
if (!Schema::hasColumn('currency_exchange_rates', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table->foreign('user_group_id', 'cer_to_ugi')->references('id')->on('user_groups')->onDelete('set null')->onUpdate('cascade');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -57,17 +54,14 @@ return new class () extends Migration {
public function down(): void
{
try {
Schema::table(
'currency_exchange_rates',
static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('cer_to_ugi');
}
if (Schema::hasColumn('currency_exchange_rates', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
Schema::table('currency_exchange_rates', static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign('cer_to_ugi');
}
);
if (Schema::hasColumn('currency_exchange_rates', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -27,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*
@@ -47,7 +47,9 @@ return new class () extends Migration {
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "notifications": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -27,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*
@@ -49,7 +49,9 @@ return new class () extends Migration {
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "invited_users": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -27,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*
@@ -54,7 +54,9 @@ return new class () extends Migration {
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "audit_log_entries": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -27,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*
@@ -36,17 +36,17 @@ return new class () extends Migration {
public function up(): void
{
try {
Schema::table(
'object_groups',
static function (Blueprint $table): void {
if (!Schema::hasColumn('object_groups', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table->foreign('user_group_id', sprintf('%s_to_ugi', 'object_groups'))->references('id')->on('user_groups')->onDelete(
'set null'
)->onUpdate('cascade');
}
Schema::table('object_groups', static function (Blueprint $table): void {
if (!Schema::hasColumn('object_groups', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table
->foreign('user_group_id', sprintf('%s_to_ugi', 'object_groups'))
->references('id')
->on('user_groups')
->onDelete('set null')
->onUpdate('cascade');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -59,17 +59,14 @@ return new class () extends Migration {
public function down(): void
{
try {
Schema::table(
'object_groups',
static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign(sprintf('%s_to_ugi', 'object_groups'));
}
if (Schema::hasColumn('object_groups', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
Schema::table('object_groups', static function (Blueprint $table): void {
if ('sqlite' !== config('database.default')) {
$table->dropForeign(sprintf('%s_to_ugi', 'object_groups'));
}
);
if (Schema::hasColumn('object_groups', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -27,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* @SuppressWarnings("PHPMD.ShortMethodName")
* Run the migrations.
@@ -49,7 +49,9 @@ return new class () extends Migration {
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "transaction_currency_user": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
@@ -68,7 +70,9 @@ return new class () extends Migration {
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not create table "transaction_currency_user_group": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
}

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2024_03_03_174645_add_indices.php
* Copyright (c) 2025 james@firefly-iii.org.
@@ -28,7 +27,7 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
private const string QUERY_ERROR = 'Could not execute query (table "%s", field "%s"): %s';
private const string EXPL = 'If the index already exists (see error), or if MySQL can\'t do it, this is not an problem. Otherwise, please open a GitHub discussion.';
@@ -46,19 +45,24 @@ return new class () extends Migration {
'category_transaction_journal' => ['transaction_journal_id'],
'categories' => ['user_id', 'user_group_id'],
'transaction_groups' => ['user_id', 'user_group_id'],
'transaction_journals' => ['user_id', 'user_group_id', 'date', 'transaction_group_id', 'transaction_type_id', 'transaction_currency_id', 'bill_id'],
'transactions' => ['account_id', 'transaction_journal_id', 'transaction_currency_id', 'foreign_currency_id'],
'transaction_journals' => [
'user_id',
'user_group_id',
'date',
'transaction_group_id',
'transaction_type_id',
'transaction_currency_id',
'bill_id'
],
'transactions' => ['account_id', 'transaction_journal_id', 'transaction_currency_id', 'foreign_currency_id']
];
foreach ($set as $table => $fields) {
foreach ($fields as $field) {
try {
Schema::table(
$table,
static function (Blueprint $blueprint) use ($field): void {
$blueprint->index($field);
}
);
Schema::table($table, static function (Blueprint $blueprint) use ($field): void {
$blueprint->index($field);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::QUERY_ERROR, $table, $field, $e->getMessage()));
app('log')->error(self::EXPL);
@@ -70,5 +74,7 @@ return new class () extends Migration {
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
};

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2024_04_01_174351_expand_preferences_table.php
* Copyright (c) 2025 james@firefly-iii.org.
@@ -28,22 +27,19 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
try {
Schema::table(
'preferences',
static function (Blueprint $table): void {
if (!Schema::hasColumn('preferences', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table->foreign('user_group_id', 'preferences_to_ugi')->references('id')->on('user_groups')->onDelete('set null')->onUpdate('cascade');
}
Schema::table('preferences', static function (Blueprint $table): void {
if (!Schema::hasColumn('preferences', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table->foreign('user_group_id', 'preferences_to_ugi')->references('id')->on('user_groups')->onDelete('set null')->onUpdate('cascade');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -53,5 +49,7 @@ return new class () extends Migration {
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
};

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2024_05_12_060551_create_account_balance_table.php
* Copyright (c) 2025 james@firefly-iii.org.
@@ -27,7 +26,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*/

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2024_07_28_145631_add_running_balance.php
* Copyright (c) 2025 james@firefly-iii.org.
@@ -28,49 +27,40 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'balance_before')) {
$table->decimal('balance_before', 32, 12)->nullable()->after('amount');
}
Schema::table('transactions', static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'balance_before')) {
$table->decimal('balance_before', 32, 12)->nullable()->after('amount');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'balance_after')) {
$table->decimal('balance_after', 32, 12)->nullable()->after('balance_before');
}
Schema::table('transactions', static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'balance_after')) {
$table->decimal('balance_after', 32, 12)->nullable()->after('balance_before');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'balance_dirty')) {
$table->boolean('balance_dirty')->default(true)->after('balance_after');
}
Schema::table('transactions', static function (Blueprint $table): void {
if (!Schema::hasColumn('transactions', 'balance_dirty')) {
$table->boolean('balance_dirty')->default(true)->after('balance_after');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
@@ -83,42 +73,33 @@ return new class () extends Migration {
public function down(): void
{
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'balance_before')) {
$table->dropColumn('balance_before');
}
Schema::table('transactions', static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'balance_before')) {
$table->dropColumn('balance_before');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'balance_after')) {
$table->dropColumn('balance_after');
}
Schema::table('transactions', static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'balance_after')) {
$table->dropColumn('balance_after');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
try {
Schema::table(
'transactions',
static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'balance_dirty')) {
$table->dropColumn('balance_dirty');
}
Schema::table('transactions', static function (Blueprint $table): void {
if (Schema::hasColumn('transactions', 'balance_dirty')) {
$table->dropColumn('balance_dirty');
}
);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2024_11_05_062108_add_date_tz_columns.php
* Copyright (c) 2025 james@firefly-iii.org.
@@ -28,24 +27,24 @@ use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
private array $tables;
public function __construct()
{
$this->tables = [
'account_balances' => ['date'], // done
'available_budgets' => ['start_date', 'end_date'], // done
'bills' => ['date', 'end_date', 'extension_date'], // done
'budget_limits' => ['start_date', 'end_date'], // done
'account_balances' => ['date'], // done
'available_budgets' => ['start_date', 'end_date'], // done
'bills' => ['date', 'end_date', 'extension_date'], // done
'budget_limits' => ['start_date', 'end_date'], // done
'currency_exchange_rates' => ['date'], // done
'invited_users' => ['expires'],
'piggy_bank_events' => ['date'],
'piggy_bank_repetitions' => ['startdate', 'targetdate'],
'piggy_banks' => ['startdate', 'targetdate'], // done
'recurrences' => ['first_date', 'repeat_until', 'latest_date'],
'tags' => ['date'],
'transaction_journals' => ['date'],
'invited_users' => ['expires'],
'piggy_bank_events' => ['date'],
'piggy_bank_repetitions' => ['startdate', 'targetdate'],
'piggy_banks' => ['startdate', 'targetdate'], // done
'recurrences' => ['first_date', 'repeat_until', 'latest_date'],
'tags' => ['date'],
'transaction_journals' => ['date']
];
}
@@ -60,15 +59,14 @@ return new class () extends Migration {
$newColumn = sprintf('%s_tz', $column);
if (Schema::hasColumn($table, $column) && !Schema::hasColumn($table, $newColumn)) {
try {
Schema::table(
$table,
static function (Blueprint $table) use ($column, $newColumn): void {
$table->string($newColumn, 50)->nullable()->after($column);
}
);
Schema::table($table, static function (Blueprint $table) use ($column, $newColumn): void {
$table->string($newColumn, 50)->nullable()->after($column);
});
} catch (QueryException $e) {
app('log')->error(sprintf('Could not add column "%s" to table "%s" query: %s', $newColumn, $table, $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
app('log')->error(
'If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.'
);
}
}
}
@@ -78,5 +76,7 @@ return new class () extends Migration {
/**
* Reverse the migrations.
*/
public function down(): void {}
public function down(): void
{
}
};

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2024_11_30_075826_multi_piggy.php
* Copyright (c) 2025 james@firefly-iii.org.
@@ -28,7 +27,7 @@ use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
return new class() extends Migration {
/**
* Run the migrations.
*/
@@ -114,7 +113,6 @@ return new class () extends Migration {
$table->unique(['account_id', 'piggy_bank_id'], 'unique_piggy_save');
});
}
}
/**
@@ -161,7 +159,6 @@ return new class () extends Migration {
protected static function hasForeign(string $table, string $column): bool
{
$foreignKeysDefinitions = Schema::getForeignKeys($table);
foreach ($foreignKeysDefinitions as $foreignKeyDefinition) {
if ($foreignKeyDefinition['name'] === $column) {

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2024_12_19_061003_add_native_amount_column.php
* Copyright (c) 2025 james@firefly-iii.org.
@@ -27,21 +26,19 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
private array $tables
= [
// !!! this array is also in PreferencesEventHandler + RecalculateNativeAmountsCommand
'accounts' => ['native_virtual_balance'], // works.
'account_piggy_bank' => ['native_current_amount'], // works
'auto_budgets' => ['native_amount'], // works
'available_budgets' => ['native_amount'], // works
'bills' => ['native_amount_min', 'native_amount_max'], // works
'budget_limits' => ['native_amount'], // works
'piggy_bank_events' => ['native_amount'], // works
'piggy_banks' => ['native_target_amount'], // works
'transactions' => ['native_amount', 'native_foreign_amount'], // works
];
return new class() extends Migration {
private array $tables = [
// !!! this array is also in PreferencesEventHandler + RecalculateNativeAmountsCommand
'accounts' => ['native_virtual_balance'], // works.
'account_piggy_bank' => ['native_current_amount'], // works
'auto_budgets' => ['native_amount'], // works
'available_budgets' => ['native_amount'], // works
'bills' => ['native_amount_min', 'native_amount_max'], // works
'budget_limits' => ['native_amount'], // works
'piggy_bank_events' => ['native_amount'], // works
'piggy_banks' => ['native_target_amount'], // works
'transactions' => ['native_amount', 'native_foreign_amount'] // works
];
/**
* Run the migrations.

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2025_07_10_065736_rename_tag_mode.php
* Copyright (c) 2025 james@firefly-iii.org

View File

@@ -1,6 +1,5 @@
<?php
/*
* 2025_08_19_180459_create_webhook_details_tables.php
* Copyright (c) 2025 james@firefly-iii.org
@@ -66,42 +65,35 @@ return new class extends Migration {
// webhook_webhook_trigger
if (!Schema::hasTable('webhook_webhook_trigger')) {
try {
Schema::create(
'webhook_webhook_trigger',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('webhook_id', false, true);
$table->bigInteger('webhook_trigger_id', false, true);
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
$table->foreign('webhook_trigger_id','link_to_trigger')->references('id')->on('webhook_triggers')->onDelete('cascade');
Schema::create('webhook_webhook_trigger', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('webhook_id', false, true);
$table->bigInteger('webhook_trigger_id', false, true);
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
$table->foreign('webhook_trigger_id', 'link_to_trigger')->references('id')->on('webhook_triggers')->onDelete('cascade');
// unique combi:
$table->unique(['webhook_id', 'webhook_trigger_id']);
}
);
// unique combi:
$table->unique(['webhook_id', 'webhook_trigger_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'webhook_webhook_trigger', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
// webhook_webhook_response
if (!Schema::hasTable('webhook_webhook_response')) {
try {
Schema::create(
'webhook_webhook_response',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('webhook_id', false, true);
$table->bigInteger('webhook_response_id', false, true);
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
$table->foreign('webhook_response_id','link_to_response')->references('id')->on('webhook_responses')->onDelete('cascade');
Schema::create('webhook_webhook_response', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('webhook_id', false, true);
$table->bigInteger('webhook_response_id', false, true);
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
$table->foreign('webhook_response_id', 'link_to_response')->references('id')->on('webhook_responses')->onDelete('cascade');
// unique combi:
$table->unique(['webhook_id', 'webhook_response_id']);
}
);
// unique combi:
$table->unique(['webhook_id', 'webhook_response_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'webhook_webhook_response', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
@@ -111,25 +103,21 @@ return new class extends Migration {
// webhook_webhook_delivery
if (!Schema::hasTable('webhook_webhook_delivery')) {
try {
Schema::create(
'webhook_webhook_delivery',
static function (Blueprint $table): void {
$table->increments('id');
$table->integer('webhook_id', false, true);
$table->bigInteger('webhook_delivery_id', false, true);
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
$table->foreign('webhook_delivery_id','link_to_delivery')->references('id')->on('webhook_deliveries')->onDelete('cascade');
Schema::create('webhook_webhook_delivery', static function (Blueprint $table): void {
$table->increments('id');
$table->integer('webhook_id', false, true);
$table->bigInteger('webhook_delivery_id', false, true);
$table->foreign('webhook_id')->references('id')->on('webhooks')->onDelete('cascade');
$table->foreign('webhook_delivery_id', 'link_to_delivery')->references('id')->on('webhook_deliveries')->onDelete('cascade');
// unique combi:
$table->unique(['webhook_id', 'webhook_delivery_id']);
}
);
// unique combi:
$table->unique(['webhook_id', 'webhook_delivery_id']);
});
} catch (QueryException $e) {
app('log')->error(sprintf(self::TABLE_ERROR, 'webhook_webhook_delivery', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
/**

View File

@@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
return new class extends Migration {
/**
* Run the migrations.
*/

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Fixes #11620
*/
return new class extends Migration {
public function up(): void
{
Schema::table('transactions', static function (Blueprint $blueprint): void {
$blueprint->index(['transaction_journal_id', 'amount'], 'idx_tx_journal_amount');
});
Schema::table('tag_transaction_journal', static function (Blueprint $blueprint): void {
$blueprint->index(['transaction_journal_id', 'tag_id'], 'idx_ttj_journal_tag');
});
Schema::table('transaction_journals', static function (Blueprint $blueprint): void {
$blueprint->index(['deleted_at'], 'idx_tj_deleted');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
//
}
};

View File

@@ -86,6 +86,7 @@ class TransactionCurrencySeeder extends Seeder
$currencies[] = ['code' => 'KZT', 'name' => 'Kazakhstani tenge', 'symbol' => '₸', 'decimal_places' => 2];
$currencies[] = ['code' => 'SAR', 'name' => 'Saudi Riyal', 'symbol' => 'SAR', 'decimal_places' => 2];
$currencies[] = ['code' => 'RSD', 'name' => 'Serbian Dinar', 'symbol' => 'RSD', 'decimal_places' => 2];
$currencies[] = ['code' => 'TWD', 'name' => 'New Taiwan Dollar', 'symbol' => 'NT$', 'decimal_places' => 0];
foreach ($currencies as $currency) {
if (null === TransactionCurrency::where('code', $currency['code'])->first()) {

View File

@@ -4,7 +4,7 @@ php-version = "8.4.0"
[source]
workspace = "."
paths = ["app/", "database/factories/", "database/seeders/", "tests/", "resources/lang/en_US"]
paths = ["app/", "database/factories/", "database/migrations/", "database/seeders/", "tests/", "resources/lang/en_US"]
includes = ["vendor"]
excludes = []

396
package-lock.json generated
View File

@@ -17,9 +17,9 @@
}
},
"node_modules/@babel/code-frame": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.28.6.tgz",
"integrity": "sha512-JYgintcMjRiCvS8mMECzaEn+m3PfoQiyqukOMCCVQtoJGYJw8j/8LBJEiqkHLkfwCcs74E3pbAUFNg7d9VNJ+Q==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.0.tgz",
"integrity": "sha512-9NhCeYjq9+3uxgdtp20LSiJXJvN0FeCtNGpJxuMFZ1Kv3cWUNb6DOhJwUvcVCzKGR66cw4njwM6hrJLqgOwbcw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -32,9 +32,9 @@
}
},
"node_modules/@babel/compat-data": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.28.6.tgz",
"integrity": "sha512-2lfu57JtzctfIrcGMz992hyLlByuzgIk58+hhGCxjKZ3rWI82NnVLjXcaTqkI2NvlcvOskZaiZ5kjUALo3Lpxg==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.29.0.tgz",
"integrity": "sha512-T1NCJqT/j9+cn8fvkt7jtwbLBfLC/1y1c7NtCeXFRgzGTsafi68MRv8yzkYSapBnFA6L3U2VSc02ciDzoAJhJg==",
"dev": true,
"license": "MIT",
"engines": {
@@ -42,21 +42,21 @@
}
},
"node_modules/@babel/core": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.28.6.tgz",
"integrity": "sha512-H3mcG6ZDLTlYfaSNi0iOKkigqMFvkTKlGUYlD8GW7nNOYRrevuA46iTypPyv+06V3fEmvvazfntkBU34L0azAw==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.29.0.tgz",
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.28.6",
"@babel/generator": "^7.28.6",
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
"@babel/helper-compilation-targets": "^7.28.6",
"@babel/helper-module-transforms": "^7.28.6",
"@babel/helpers": "^7.28.6",
"@babel/parser": "^7.28.6",
"@babel/parser": "^7.29.0",
"@babel/template": "^7.28.6",
"@babel/traverse": "^7.28.6",
"@babel/types": "^7.28.6",
"@babel/traverse": "^7.29.0",
"@babel/types": "^7.29.0",
"@jridgewell/remapping": "^2.3.5",
"convert-source-map": "^2.0.0",
"debug": "^4.1.0",
@@ -83,14 +83,14 @@
}
},
"node_modules/@babel/generator": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.28.6.tgz",
"integrity": "sha512-lOoVRwADj8hjf7al89tvQ2a1lf53Z+7tiXMgpZJL3maQPDxh0DgLMN62B2MKUOFcoodBHLMbDM6WAbKgNy5Suw==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.29.0.tgz",
"integrity": "sha512-vSH118/wwM/pLR38g/Sgk05sNtro6TlTJKuiMXDaZqPUfjTFcudpCOt00IhOfj+1BFAX+UFAlzCU+6WXr3GLFQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.28.6",
"@babel/types": "^7.28.6",
"@babel/parser": "^7.29.0",
"@babel/types": "^7.29.0",
"@jridgewell/gen-mapping": "^0.3.12",
"@jridgewell/trace-mapping": "^0.3.28",
"jsesc": "^3.0.2"
@@ -405,13 +405,13 @@
}
},
"node_modules/@babel/parser": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.28.6.tgz",
"integrity": "sha512-TeR9zWR18BvbfPmGbLampPMW+uW1NZnJlRuuHso8i87QZNq2JRF9i6RgxRqtEq+wQGsS19NNTWr2duhnE49mfQ==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.29.0.tgz",
"integrity": "sha512-IyDgFV5GeDUVX4YdF/3CPULtVGSXXMLh1xVIgdCgxApktqnQV0r7/8Nqthg+8YLGaAtdyIlo2qIdZrbCv4+7ww==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/types": "^7.28.6"
"@babel/types": "^7.29.0"
},
"bin": {
"parser": "bin/babel-parser.js"
@@ -630,15 +630,15 @@
}
},
"node_modules/@babel/plugin-transform-async-generator-functions": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.28.6.tgz",
"integrity": "sha512-9knsChgsMzBV5Yh3kkhrZNxH3oCYAfMBkNNaVN4cP2RVlFPe8wYdwwcnOsAbkdDoV9UjFtOXWrWB52M8W4jNeA==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-generator-functions/-/plugin-transform-async-generator-functions-7.29.0.tgz",
"integrity": "sha512-va0VdWro4zlBr2JsXC+ofCPB2iG12wPtVGTWFx2WLDOM3nYQZZIGP82qku2eW/JR83sD+k2k+CsNtyEbUqhU6w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-plugin-utils": "^7.28.6",
"@babel/helper-remap-async-to-generator": "^7.27.1",
"@babel/traverse": "^7.28.6"
"@babel/traverse": "^7.29.0"
},
"engines": {
"node": ">=6.9.0"
@@ -820,9 +820,9 @@
}
},
"node_modules/@babel/plugin-transform-duplicate-named-capturing-groups-regex": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.28.6.tgz",
"integrity": "sha512-5suVoXjC14lUN6ZL9OLKIHCNVWCrqGqlmEp/ixdXjvgnEl/kauLvvMO/Xw9NyMc95Joj1AeLVPVMvibBgSoFlA==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-named-capturing-groups-regex/-/plugin-transform-duplicate-named-capturing-groups-regex-7.29.0.tgz",
"integrity": "sha512-zBPcW2lFGxdiD8PUnPwJjag2J9otbcLQzvbiOzDxpYXyCuYX9agOwMPGn1prVH0a4qzhCKu24rlH4c1f7yA8rw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1035,16 +1035,16 @@
}
},
"node_modules/@babel/plugin-transform-modules-systemjs": {
"version": "7.28.5",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.28.5.tgz",
"integrity": "sha512-vn5Jma98LCOeBy/KpeQhXcV2WZgaRUtjwQmjoBuLNlOmkg0fB5pdvYVeWRYI69wWKwK2cD1QbMiUQnoujWvrew==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.29.0.tgz",
"integrity": "sha512-PrujnVFbOdUpw4UHiVwKvKRLMMic8+eC0CuNlxjsyZUiBjhFdPsewdXCkveh2KqBA9/waD0W1b4hXSOBQJezpQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-module-transforms": "^7.28.3",
"@babel/helper-plugin-utils": "^7.27.1",
"@babel/helper-module-transforms": "^7.28.6",
"@babel/helper-plugin-utils": "^7.28.6",
"@babel/helper-validator-identifier": "^7.28.5",
"@babel/traverse": "^7.28.5"
"@babel/traverse": "^7.29.0"
},
"engines": {
"node": ">=6.9.0"
@@ -1071,14 +1071,14 @@
}
},
"node_modules/@babel/plugin-transform-named-capturing-groups-regex": {
"version": "7.27.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.27.1.tgz",
"integrity": "sha512-SstR5JYy8ddZvD6MhV0tM/j16Qds4mIpJTOd1Yu9J9pJjH93bxHECF7pgtc28XvkzTD6Pxcm/0Z73Hvk7kb3Ng==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.29.0.tgz",
"integrity": "sha512-1CZQA5KNAD6ZYQLPw7oi5ewtDNxH/2vuCh+6SmvgDfhumForvs8a1o9n0UrEoBD8HU4djO2yWngTQlXl1NDVEQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-create-regexp-features-plugin": "^7.27.1",
"@babel/helper-plugin-utils": "^7.27.1"
"@babel/helper-create-regexp-features-plugin": "^7.28.5",
"@babel/helper-plugin-utils": "^7.28.6"
},
"engines": {
"node": ">=6.9.0"
@@ -1273,9 +1273,9 @@
}
},
"node_modules/@babel/plugin-transform-regenerator": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.28.6.tgz",
"integrity": "sha512-eZhoEZHYQLL5uc1gS5e9/oTknS0sSSAtd5TkKMUp3J+S/CaUjagc0kOUPsEbDmMeva0nC3WWl4SxVY6+OBuxfw==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.29.0.tgz",
"integrity": "sha512-FijqlqMA7DmRdg/aINBSs04y8XNTYw/lr1gJ2WsmBnnaNw1iS43EPkJW+zK7z65auG3AWRFXWj+NcTQwYptUog==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -1322,14 +1322,14 @@
}
},
"node_modules/@babel/plugin-transform-runtime": {
"version": "7.28.5",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.28.5.tgz",
"integrity": "sha512-20NUVgOrinudkIBzQ2bNxP08YpKprUkRTiRSd2/Z5GOdPImJGkoN4Z7IQe1T5AdyKI1i5L6RBmluqdSzvaq9/w==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.29.0.tgz",
"integrity": "sha512-jlaRT5dJtMaMCV6fAuLbsQMSwz/QkvaHOHOSXRitGGwSpR1blCY4KUKoyP2tYO8vJcqYe8cEj96cqSztv3uF9w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-module-imports": "^7.27.1",
"@babel/helper-plugin-utils": "^7.27.1",
"@babel/helper-module-imports": "^7.28.6",
"@babel/helper-plugin-utils": "^7.28.6",
"babel-plugin-polyfill-corejs2": "^0.4.14",
"babel-plugin-polyfill-corejs3": "^0.13.0",
"babel-plugin-polyfill-regenerator": "^0.6.5",
@@ -1501,13 +1501,13 @@
}
},
"node_modules/@babel/preset-env": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.28.6.tgz",
"integrity": "sha512-GaTI4nXDrs7l0qaJ6Rg06dtOXTBCG6TMDB44zbqofCIC4PqC7SEvmFFtpxzCDw9W5aJ7RKVshgXTLvLdBFV/qw==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.29.0.tgz",
"integrity": "sha512-fNEdfc0yi16lt6IZo2Qxk3knHVdfMYX33czNb4v8yWhemoBhibCpQK/uYHtSKIiO+p/zd3+8fYVXhQdOVV608w==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/compat-data": "^7.28.6",
"@babel/compat-data": "^7.29.0",
"@babel/helper-compilation-targets": "^7.28.6",
"@babel/helper-plugin-utils": "^7.28.6",
"@babel/helper-validator-option": "^7.27.1",
@@ -1521,7 +1521,7 @@
"@babel/plugin-syntax-import-attributes": "^7.28.6",
"@babel/plugin-syntax-unicode-sets-regex": "^7.18.6",
"@babel/plugin-transform-arrow-functions": "^7.27.1",
"@babel/plugin-transform-async-generator-functions": "^7.28.6",
"@babel/plugin-transform-async-generator-functions": "^7.29.0",
"@babel/plugin-transform-async-to-generator": "^7.28.6",
"@babel/plugin-transform-block-scoped-functions": "^7.27.1",
"@babel/plugin-transform-block-scoping": "^7.28.6",
@@ -1532,7 +1532,7 @@
"@babel/plugin-transform-destructuring": "^7.28.5",
"@babel/plugin-transform-dotall-regex": "^7.28.6",
"@babel/plugin-transform-duplicate-keys": "^7.27.1",
"@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.28.6",
"@babel/plugin-transform-duplicate-named-capturing-groups-regex": "^7.29.0",
"@babel/plugin-transform-dynamic-import": "^7.27.1",
"@babel/plugin-transform-explicit-resource-management": "^7.28.6",
"@babel/plugin-transform-exponentiation-operator": "^7.28.6",
@@ -1545,9 +1545,9 @@
"@babel/plugin-transform-member-expression-literals": "^7.27.1",
"@babel/plugin-transform-modules-amd": "^7.27.1",
"@babel/plugin-transform-modules-commonjs": "^7.28.6",
"@babel/plugin-transform-modules-systemjs": "^7.28.5",
"@babel/plugin-transform-modules-systemjs": "^7.29.0",
"@babel/plugin-transform-modules-umd": "^7.27.1",
"@babel/plugin-transform-named-capturing-groups-regex": "^7.27.1",
"@babel/plugin-transform-named-capturing-groups-regex": "^7.29.0",
"@babel/plugin-transform-new-target": "^7.27.1",
"@babel/plugin-transform-nullish-coalescing-operator": "^7.28.6",
"@babel/plugin-transform-numeric-separator": "^7.28.6",
@@ -1559,7 +1559,7 @@
"@babel/plugin-transform-private-methods": "^7.28.6",
"@babel/plugin-transform-private-property-in-object": "^7.28.6",
"@babel/plugin-transform-property-literals": "^7.27.1",
"@babel/plugin-transform-regenerator": "^7.28.6",
"@babel/plugin-transform-regenerator": "^7.29.0",
"@babel/plugin-transform-regexp-modifiers": "^7.28.6",
"@babel/plugin-transform-reserved-words": "^7.27.1",
"@babel/plugin-transform-shorthand-properties": "^7.27.1",
@@ -1572,10 +1572,10 @@
"@babel/plugin-transform-unicode-regex": "^7.27.1",
"@babel/plugin-transform-unicode-sets-regex": "^7.28.6",
"@babel/preset-modules": "0.1.6-no-external-plugins",
"babel-plugin-polyfill-corejs2": "^0.4.14",
"babel-plugin-polyfill-corejs3": "^0.13.0",
"babel-plugin-polyfill-regenerator": "^0.6.5",
"core-js-compat": "^3.43.0",
"babel-plugin-polyfill-corejs2": "^0.4.15",
"babel-plugin-polyfill-corejs3": "^0.14.0",
"babel-plugin-polyfill-regenerator": "^0.6.6",
"core-js-compat": "^3.48.0",
"semver": "^6.3.1"
},
"engines": {
@@ -1585,6 +1585,20 @@
"@babel/core": "^7.0.0-0"
}
},
"node_modules/@babel/preset-env/node_modules/babel-plugin-polyfill-corejs3": {
"version": "0.14.0",
"resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.14.0.tgz",
"integrity": "sha512-AvDcMxJ34W4Wgy4KBIIePQTAOP1Ie2WFwkQp3dB7FQ/f0lI5+nM96zUnYEOE1P9sEg0es5VCP0HxiWu5fUHZAQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/helper-define-polyfill-provider": "^0.6.6",
"core-js-compat": "^3.48.0"
},
"peerDependencies": {
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
}
},
"node_modules/@babel/preset-env/node_modules/semver": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz",
@@ -1635,18 +1649,18 @@
}
},
"node_modules/@babel/traverse": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.28.6.tgz",
"integrity": "sha512-fgWX62k02qtjqdSNTAGxmKYY/7FSL9WAS1o2Hu5+I5m9T0yxZzr4cnrfXQ/MX0rIifthCSs6FKTlzYbJcPtMNg==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.29.0.tgz",
"integrity": "sha512-4HPiQr0X7+waHfyXPZpWPfWL/J7dcN1mx9gL6WdQVMbPnF3+ZhSMs8tCxN7oHddJE9fhNE7+lxdnlyemKfJRuA==",
"dev": true,
"license": "MIT",
"dependencies": {
"@babel/code-frame": "^7.28.6",
"@babel/generator": "^7.28.6",
"@babel/code-frame": "^7.29.0",
"@babel/generator": "^7.29.0",
"@babel/helper-globals": "^7.28.0",
"@babel/parser": "^7.28.6",
"@babel/parser": "^7.29.0",
"@babel/template": "^7.28.6",
"@babel/types": "^7.28.6",
"@babel/types": "^7.29.0",
"debug": "^4.3.1"
},
"engines": {
@@ -1654,9 +1668,9 @@
}
},
"node_modules/@babel/types": {
"version": "7.28.6",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.28.6.tgz",
"integrity": "sha512-0ZrskXVEHSWIqZM/sQZ4EV3jZJXRkio/WCxaqKZP1g//CEWEPSfeZFcms4XeKBCHU0ZKnIkdJeU/kF+eRp5lBg==",
"version": "7.29.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.29.0.tgz",
"integrity": "sha512-LwdZHpScM4Qz8Xw2iKSzS+cfglZzJGvofQICy7W7v4caru4EaAmyUuO6BGrbyQ2mYV11W0U8j5mBhd14dd3B0A==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -2606,9 +2620,9 @@
}
},
"node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.0.tgz",
"integrity": "sha512-tPgXB6cDTndIe1ah7u6amCI1T0SsnlOuKgg10Xh3uizJk4e5M1JGaUMk7J4ciuAUcFpbOiNhm2XIjP9ON0dUqA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.57.1.tgz",
"integrity": "sha512-A6ehUVSiSaaliTxai040ZpZ2zTevHYbvu/lDoeAteHI8QnaosIzm4qwtezfRg1jOYaUmnzLX1AOD6Z+UJjtifg==",
"cpu": [
"arm"
],
@@ -2620,9 +2634,9 @@
]
},
"node_modules/@rollup/rollup-android-arm64": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.0.tgz",
"integrity": "sha512-sa4LyseLLXr1onr97StkU1Nb7fWcg6niokTwEVNOO7awaKaoRObQ54+V/hrF/BP1noMEaaAW6Fg2d/CfLiq3Mg==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.57.1.tgz",
"integrity": "sha512-dQaAddCY9YgkFHZcFNS/606Exo8vcLHwArFZ7vxXq4rigo2bb494/xKMMwRRQW6ug7Js6yXmBZhSBRuBvCCQ3w==",
"cpu": [
"arm64"
],
@@ -2634,9 +2648,9 @@
]
},
"node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.0.tgz",
"integrity": "sha512-/NNIj9A7yLjKdmkx5dC2XQ9DmjIECpGpwHoGmA5E1AhU0fuICSqSWScPhN1yLCkEdkCwJIDu2xIeLPs60MNIVg==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.57.1.tgz",
"integrity": "sha512-crNPrwJOrRxagUYeMn/DZwqN88SDmwaJ8Cvi/TN1HnWBU7GwknckyosC2gd0IqYRsHDEnXf328o9/HC6OkPgOg==",
"cpu": [
"arm64"
],
@@ -2648,9 +2662,9 @@
]
},
"node_modules/@rollup/rollup-darwin-x64": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.0.tgz",
"integrity": "sha512-xoh8abqgPrPYPr7pTYipqnUi1V3em56JzE/HgDgitTqZBZ3yKCWI+7KUkceM6tNweyUKYru1UMi7FC060RyKwA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.57.1.tgz",
"integrity": "sha512-Ji8g8ChVbKrhFtig5QBV7iMaJrGtpHelkB3lsaKzadFBe58gmjfGXAOfI5FV0lYMH8wiqsxKQ1C9B0YTRXVy4w==",
"cpu": [
"x64"
],
@@ -2662,9 +2676,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-arm64": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.0.tgz",
"integrity": "sha512-PCkMh7fNahWSbA0OTUQ2OpYHpjZZr0hPr8lId8twD7a7SeWrvT3xJVyza+dQwXSSq4yEQTMoXgNOfMCsn8584g==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.57.1.tgz",
"integrity": "sha512-R+/WwhsjmwodAcz65guCGFRkMb4gKWTcIeLy60JJQbXrJ97BOXHxnkPFrP+YwFlaS0m+uWJTstrUA9o+UchFug==",
"cpu": [
"arm64"
],
@@ -2676,9 +2690,9 @@
]
},
"node_modules/@rollup/rollup-freebsd-x64": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.0.tgz",
"integrity": "sha512-1j3stGx+qbhXql4OCDZhnK7b01s6rBKNybfsX+TNrEe9JNq4DLi1yGiR1xW+nL+FNVvI4D02PUnl6gJ/2y6WJA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.57.1.tgz",
"integrity": "sha512-IEQTCHeiTOnAUC3IDQdzRAGj3jOAYNr9kBguI7MQAAZK3caezRrg0GxAb6Hchg4lxdZEI5Oq3iov/w/hnFWY9Q==",
"cpu": [
"x64"
],
@@ -2690,9 +2704,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.0.tgz",
"integrity": "sha512-eyrr5W08Ms9uM0mLcKfM/Uzx7hjhz2bcjv8P2uynfj0yU8GGPdz8iYrBPhiLOZqahoAMB8ZiolRZPbbU2MAi6Q==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.57.1.tgz",
"integrity": "sha512-F8sWbhZ7tyuEfsmOxwc2giKDQzN3+kuBLPwwZGyVkLlKGdV1nvnNwYD0fKQ8+XS6hp9nY7B+ZeK01EBUE7aHaw==",
"cpu": [
"arm"
],
@@ -2704,9 +2718,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm-musleabihf": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.0.tgz",
"integrity": "sha512-Xds90ITXJCNyX9pDhqf85MKWUI4lqjiPAipJ8OLp8xqI2Ehk+TCVhF9rvOoN8xTbcafow3QOThkNnrM33uCFQA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.57.1.tgz",
"integrity": "sha512-rGfNUfn0GIeXtBP1wL5MnzSj98+PZe/AXaGBCRmT0ts80lU5CATYGxXukeTX39XBKsxzFpEeK+Mrp9faXOlmrw==",
"cpu": [
"arm"
],
@@ -2718,9 +2732,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.0.tgz",
"integrity": "sha512-Xws2KA4CLvZmXjy46SQaXSejuKPhwVdaNinldoYfqruZBaJHqVo6hnRa8SDo9z7PBW5x84SH64+izmldCgbezw==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.57.1.tgz",
"integrity": "sha512-MMtej3YHWeg/0klK2Qodf3yrNzz6CGjo2UntLvk2RSPlhzgLvYEB3frRvbEF2wRKh1Z2fDIg9KRPe1fawv7C+g==",
"cpu": [
"arm64"
],
@@ -2732,9 +2746,9 @@
]
},
"node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.0.tgz",
"integrity": "sha512-hrKXKbX5FdaRJj7lTMusmvKbhMJSGWJ+w++4KmjiDhpTgNlhYobMvKfDoIWecy4O60K6yA4SnztGuNTQF+Lplw==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.57.1.tgz",
"integrity": "sha512-1a/qhaaOXhqXGpMFMET9VqwZakkljWHLmZOX48R0I/YLbhdxr1m4gtG1Hq7++VhVUmf+L3sTAf9op4JlhQ5u1Q==",
"cpu": [
"arm64"
],
@@ -2746,9 +2760,9 @@
]
},
"node_modules/@rollup/rollup-linux-loong64-gnu": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.0.tgz",
"integrity": "sha512-6A+nccfSDGKsPm00d3xKcrsBcbqzCTAukjwWK6rbuAnB2bHaL3r9720HBVZ/no7+FhZLz/U3GwwZZEh6tOSI8Q==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-gnu/-/rollup-linux-loong64-gnu-4.57.1.tgz",
"integrity": "sha512-QWO6RQTZ/cqYtJMtxhkRkidoNGXc7ERPbZN7dVW5SdURuLeVU7lwKMpo18XdcmpWYd0qsP1bwKPf7DNSUinhvA==",
"cpu": [
"loong64"
],
@@ -2760,9 +2774,9 @@
]
},
"node_modules/@rollup/rollup-linux-loong64-musl": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.0.tgz",
"integrity": "sha512-4P1VyYUe6XAJtQH1Hh99THxr0GKMMwIXsRNOceLrJnaHTDgk1FTcTimDgneRJPvB3LqDQxUmroBclQ1S0cIJwQ==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loong64-musl/-/rollup-linux-loong64-musl-4.57.1.tgz",
"integrity": "sha512-xpObYIf+8gprgWaPP32xiN5RVTi/s5FCR+XMXSKmhfoJjrpRAjCuuqQXyxUa/eJTdAE6eJ+KDKaoEqjZQxh3Gw==",
"cpu": [
"loong64"
],
@@ -2774,9 +2788,9 @@
]
},
"node_modules/@rollup/rollup-linux-ppc64-gnu": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.0.tgz",
"integrity": "sha512-8Vv6pLuIZCMcgXre6c3nOPhE0gjz1+nZP6T+hwWjr7sVH8k0jRkH+XnfjjOTglyMBdSKBPPz54/y1gToSKwrSQ==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-gnu/-/rollup-linux-ppc64-gnu-4.57.1.tgz",
"integrity": "sha512-4BrCgrpZo4hvzMDKRqEaW1zeecScDCR+2nZ86ATLhAoJ5FQ+lbHVD3ttKe74/c7tNT9c6F2viwB3ufwp01Oh2w==",
"cpu": [
"ppc64"
],
@@ -2788,9 +2802,9 @@
]
},
"node_modules/@rollup/rollup-linux-ppc64-musl": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.0.tgz",
"integrity": "sha512-r1te1M0Sm2TBVD/RxBPC6RZVwNqUTwJTA7w+C/IW5v9Ssu6xmxWEi+iJQlpBhtUiT1raJ5b48pI8tBvEjEFnFA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-ppc64-musl/-/rollup-linux-ppc64-musl-4.57.1.tgz",
"integrity": "sha512-NOlUuzesGauESAyEYFSe3QTUguL+lvrN1HtwEEsU2rOwdUDeTMJdO5dUYl/2hKf9jWydJrO9OL/XSSf65R5+Xw==",
"cpu": [
"ppc64"
],
@@ -2802,9 +2816,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.0.tgz",
"integrity": "sha512-say0uMU/RaPm3CDQLxUUTF2oNWL8ysvHkAjcCzV2znxBr23kFfaxocS9qJm+NdkRhF8wtdEEAJuYcLPhSPbjuQ==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.57.1.tgz",
"integrity": "sha512-ptA88htVp0AwUUqhVghwDIKlvJMD/fmL/wrQj99PRHFRAG6Z5nbWoWG4o81Nt9FT+IuqUQi+L31ZKAFeJ5Is+A==",
"cpu": [
"riscv64"
],
@@ -2816,9 +2830,9 @@
]
},
"node_modules/@rollup/rollup-linux-riscv64-musl": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.0.tgz",
"integrity": "sha512-/MU7/HizQGsnBREtRpcSbSV1zfkoxSTR7wLsRmBPQ8FwUj5sykrP1MyJTvsxP5KBq9SyE6kH8UQQQwa0ASeoQQ==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.57.1.tgz",
"integrity": "sha512-S51t7aMMTNdmAMPpBg7OOsTdn4tySRQvklmL3RpDRyknk87+Sp3xaumlatU+ppQ+5raY7sSTcC2beGgvhENfuw==",
"cpu": [
"riscv64"
],
@@ -2830,9 +2844,9 @@
]
},
"node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.0.tgz",
"integrity": "sha512-Q9eh+gUGILIHEaJf66aF6a414jQbDnn29zeu0eX3dHMuysnhTvsUvZTCAyZ6tJhUjnvzBKE4FtuaYxutxRZpOg==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.57.1.tgz",
"integrity": "sha512-Bl00OFnVFkL82FHbEqy3k5CUCKH6OEJL54KCyx2oqsmZnFTR8IoNqBF+mjQVcRCT5sB6yOvK8A37LNm/kPJiZg==",
"cpu": [
"s390x"
],
@@ -2844,9 +2858,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.0.tgz",
"integrity": "sha512-OR5p5yG5OKSxHReWmwvM0P+VTPMwoBS45PXTMYaskKQqybkS3Kmugq1W+YbNWArF8/s7jQScgzXUhArzEQ7x0A==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.57.1.tgz",
"integrity": "sha512-ABca4ceT4N+Tv/GtotnWAeXZUZuM/9AQyCyKYyKnpk4yoA7QIAuBt6Hkgpw8kActYlew2mvckXkvx0FfoInnLg==",
"cpu": [
"x64"
],
@@ -2858,9 +2872,9 @@
]
},
"node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.0.tgz",
"integrity": "sha512-XeatKzo4lHDsVEbm1XDHZlhYZZSQYym6dg2X/Ko0kSFgio+KXLsxwJQprnR48GvdIKDOpqWqssC3iBCjoMcMpw==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.57.1.tgz",
"integrity": "sha512-HFps0JeGtuOR2convgRRkHCekD7j+gdAuXM+/i6kGzQtFhlCtQkpwtNzkNj6QhCDp7DRJ7+qC/1Vg2jt5iSOFw==",
"cpu": [
"x64"
],
@@ -2872,9 +2886,9 @@
]
},
"node_modules/@rollup/rollup-openbsd-x64": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.0.tgz",
"integrity": "sha512-Lu71y78F5qOfYmubYLHPcJm74GZLU6UJ4THkf/a1K7Tz2ycwC2VUbsqbJAXaR6Bx70SRdlVrt2+n5l7F0agTUw==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openbsd-x64/-/rollup-openbsd-x64-4.57.1.tgz",
"integrity": "sha512-H+hXEv9gdVQuDTgnqD+SQffoWoc0Of59AStSzTEj/feWTBAnSfSD3+Dql1ZruJQxmykT/JVY0dE8Ka7z0DH1hw==",
"cpu": [
"x64"
],
@@ -2886,9 +2900,9 @@
]
},
"node_modules/@rollup/rollup-openharmony-arm64": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.0.tgz",
"integrity": "sha512-v5xwKDWcu7qhAEcsUubiav7r+48Uk/ENWdr82MBZZRIm7zThSxCIVDfb3ZeRRq9yqk+oIzMdDo6fCcA5DHfMyA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-openharmony-arm64/-/rollup-openharmony-arm64-4.57.1.tgz",
"integrity": "sha512-4wYoDpNg6o/oPximyc/NG+mYUejZrCU2q+2w6YZqrAs2UcNUChIZXjtafAiiZSUc7On8v5NyNj34Kzj/Ltk6dQ==",
"cpu": [
"arm64"
],
@@ -2900,9 +2914,9 @@
]
},
"node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.0.tgz",
"integrity": "sha512-XnaaaSMGSI6Wk8F4KK3QP7GfuuhjGchElsVerCplUuxRIzdvZ7hRBpLR0omCmw+kI2RFJB80nenhOoGXlJ5TfQ==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.57.1.tgz",
"integrity": "sha512-O54mtsV/6LW3P8qdTcamQmuC990HDfR71lo44oZMZlXU4tzLrbvTii87Ni9opq60ds0YzuAlEr/GNwuNluZyMQ==",
"cpu": [
"arm64"
],
@@ -2914,9 +2928,9 @@
]
},
"node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.0.tgz",
"integrity": "sha512-3K1lP+3BXY4t4VihLw5MEg6IZD3ojSYzqzBG571W3kNQe4G4CcFpSUQVgurYgib5d+YaCjeFow8QivWp8vuSvA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.57.1.tgz",
"integrity": "sha512-P3dLS+IerxCT/7D2q2FYcRdWRl22dNbrbBEtxdWhXrfIMPP9lQhb5h4Du04mdl5Woq05jVCDPCMF7Ub0NAjIew==",
"cpu": [
"ia32"
],
@@ -2928,9 +2942,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-gnu": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.0.tgz",
"integrity": "sha512-MDk610P/vJGc5L5ImE4k5s+GZT3en0KoK1MKPXCRgzmksAMk79j4h3k1IerxTNqwDLxsGxStEZVBqG0gIqZqoA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-gnu/-/rollup-win32-x64-gnu-4.57.1.tgz",
"integrity": "sha512-VMBH2eOOaKGtIJYleXsi2B8CPVADrh+TyNxJ4mWPnKfLB/DBUmzW+5m1xUrcwWoMfSLagIRpjUFeW5CO5hyciQ==",
"cpu": [
"x64"
],
@@ -2942,9 +2956,9 @@
]
},
"node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.0.tgz",
"integrity": "sha512-Zv7v6q6aV+VslnpwzqKAmrk5JdVkLUzok2208ZXGipjb+msxBr/fJPZyeEXiFgH7k62Ak0SLIfxQRZQvTuf7rQ==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.57.1.tgz",
"integrity": "sha512-mxRFDdHIWRxg3UfIIAwCm6NzvxG0jDX/wBN6KsQFTvKFqqg9vTrWUE68qEjHt19A5wwx5X5aUi2zuZT7YR0jrA==",
"cpu": [
"x64"
],
@@ -3232,9 +3246,9 @@
"license": "MIT"
},
"node_modules/@types/node": {
"version": "25.0.10",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.10.tgz",
"integrity": "sha512-zWW5KPngR/yvakJgGOmZ5vTBemDoSqF3AcV/LrO5u5wTWyEAVVh+IT39G4gtyAkh3CtTZs8aX/yRM82OfzHJRg==",
"version": "25.2.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.0.tgz",
"integrity": "sha512-DZ8VwRFUNzuqJ5khrvwMXHmvPe+zGayJhr2CDNiKB1WBE1ST8Djl00D0IC4vvNmHMdj6DlbYRIaFE7WHjlDl5w==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -3834,9 +3848,9 @@
}
},
"node_modules/alpinejs": {
"version": "3.15.5",
"resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.15.5.tgz",
"integrity": "sha512-l1R4em/uCUr7eJimcO/b0L1+H2tVcB1Y7cQ3d+pzwVnv0zWs7gw4MhwdsLjfLccWV2iH0ahlfaJWitNRFOZdvQ==",
"version": "3.15.6",
"resolved": "https://registry.npmjs.org/alpinejs/-/alpinejs-3.15.6.tgz",
"integrity": "sha512-ETE0k88xU74URryk2JyvmrvyCyZG0Wo+2/tZux9gEvaPc/k5XcBSdvFHyW76puIFqhD+nHgeO/5j3pRRsHh6HA==",
"license": "MIT",
"dependencies": {
"@vue/reactivity": "~3.1.1"
@@ -3966,9 +3980,9 @@
"license": "MIT"
},
"node_modules/autoprefixer": {
"version": "10.4.23",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.23.tgz",
"integrity": "sha512-YYTXSFulfwytnjAPlw8QHncHJmlvFKtczb8InXaAx9Q0LbfDnfEYDE55omerIJKihhmU61Ft+cAOSzQVaBUmeA==",
"version": "10.4.24",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.24.tgz",
"integrity": "sha512-uHZg7N9ULTVbutaIsDRoUkoS8/h3bdsmVJYZ5l3wv8Cp/6UIIoRDm90hZ+BwxUj/hGBEzLxdHNSKuFpn8WOyZw==",
"dev": true,
"funding": [
{
@@ -3987,7 +4001,7 @@
"license": "MIT",
"dependencies": {
"browserslist": "^4.28.1",
"caniuse-lite": "^1.0.30001760",
"caniuse-lite": "^1.0.30001766",
"fraction.js": "^5.3.4",
"picocolors": "^1.1.1",
"postcss-value-parser": "^4.2.0"
@@ -4131,9 +4145,9 @@
"license": "MIT"
},
"node_modules/baseline-browser-mapping": {
"version": "2.9.18",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.18.tgz",
"integrity": "sha512-e23vBV1ZLfjb9apvfPk4rHVu2ry6RIr2Wfs+O324okSidrX7pTAnEJPCh/O5BtRlr7QtZI7ktOP3vsqr7Z5XoA==",
"version": "2.9.19",
"resolved": "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.9.19.tgz",
"integrity": "sha512-ipDqC8FrAl/76p2SSWKSI+H9tFwm7vYqXQrItCuiVPt26Km0jS+NzSsBWAaBusvSbQcfJG+JitdMm+wZAgTYqg==",
"dev": true,
"license": "Apache-2.0",
"bin": {
@@ -5769,9 +5783,9 @@
"license": "MIT"
},
"node_modules/electron-to-chromium": {
"version": "1.5.279",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.279.tgz",
"integrity": "sha512-0bblUU5UNdOt5G7XqGiJtpZMONma6WAfq9vsFmtn9x1+joAObr6x1chfqyxFSDCAFwFhCQDrqeAr6MYdpwJ9Hg==",
"version": "1.5.283",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.283.tgz",
"integrity": "sha512-3vifjt1HgrGW/h76UEeny+adYApveS9dH2h3p57JYzBSXJIKUJAvtmIytDKjcSCt9xHfrNCFJ7gts6vkhuq++w==",
"dev": true,
"license": "ISC"
},
@@ -10089,9 +10103,9 @@
}
},
"node_modules/rollup": {
"version": "4.57.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.0.tgz",
"integrity": "sha512-e5lPJi/aui4TO1LpAXIRLySmwXSE8k3b9zoGfd42p67wzxog4WHjiZF3M2uheQih4DGyc25QEV4yRBbpueNiUA==",
"version": "4.57.1",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.57.1.tgz",
"integrity": "sha512-oQL6lgK3e2QZeQ7gcgIkS2YZPg5slw37hYufJ3edKlfQSGGm8ICoxswK15ntSzF/a8+h7ekRy7k7oWc3BQ7y8A==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -10105,31 +10119,31 @@
"npm": ">=8.0.0"
},
"optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.57.0",
"@rollup/rollup-android-arm64": "4.57.0",
"@rollup/rollup-darwin-arm64": "4.57.0",
"@rollup/rollup-darwin-x64": "4.57.0",
"@rollup/rollup-freebsd-arm64": "4.57.0",
"@rollup/rollup-freebsd-x64": "4.57.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.57.0",
"@rollup/rollup-linux-arm-musleabihf": "4.57.0",
"@rollup/rollup-linux-arm64-gnu": "4.57.0",
"@rollup/rollup-linux-arm64-musl": "4.57.0",
"@rollup/rollup-linux-loong64-gnu": "4.57.0",
"@rollup/rollup-linux-loong64-musl": "4.57.0",
"@rollup/rollup-linux-ppc64-gnu": "4.57.0",
"@rollup/rollup-linux-ppc64-musl": "4.57.0",
"@rollup/rollup-linux-riscv64-gnu": "4.57.0",
"@rollup/rollup-linux-riscv64-musl": "4.57.0",
"@rollup/rollup-linux-s390x-gnu": "4.57.0",
"@rollup/rollup-linux-x64-gnu": "4.57.0",
"@rollup/rollup-linux-x64-musl": "4.57.0",
"@rollup/rollup-openbsd-x64": "4.57.0",
"@rollup/rollup-openharmony-arm64": "4.57.0",
"@rollup/rollup-win32-arm64-msvc": "4.57.0",
"@rollup/rollup-win32-ia32-msvc": "4.57.0",
"@rollup/rollup-win32-x64-gnu": "4.57.0",
"@rollup/rollup-win32-x64-msvc": "4.57.0",
"@rollup/rollup-android-arm-eabi": "4.57.1",
"@rollup/rollup-android-arm64": "4.57.1",
"@rollup/rollup-darwin-arm64": "4.57.1",
"@rollup/rollup-darwin-x64": "4.57.1",
"@rollup/rollup-freebsd-arm64": "4.57.1",
"@rollup/rollup-freebsd-x64": "4.57.1",
"@rollup/rollup-linux-arm-gnueabihf": "4.57.1",
"@rollup/rollup-linux-arm-musleabihf": "4.57.1",
"@rollup/rollup-linux-arm64-gnu": "4.57.1",
"@rollup/rollup-linux-arm64-musl": "4.57.1",
"@rollup/rollup-linux-loong64-gnu": "4.57.1",
"@rollup/rollup-linux-loong64-musl": "4.57.1",
"@rollup/rollup-linux-ppc64-gnu": "4.57.1",
"@rollup/rollup-linux-ppc64-musl": "4.57.1",
"@rollup/rollup-linux-riscv64-gnu": "4.57.1",
"@rollup/rollup-linux-riscv64-musl": "4.57.1",
"@rollup/rollup-linux-s390x-gnu": "4.57.1",
"@rollup/rollup-linux-x64-gnu": "4.57.1",
"@rollup/rollup-linux-x64-musl": "4.57.1",
"@rollup/rollup-openbsd-x64": "4.57.1",
"@rollup/rollup-openharmony-arm64": "4.57.1",
"@rollup/rollup-win32-arm64-msvc": "4.57.1",
"@rollup/rollup-win32-ia32-msvc": "4.57.1",
"@rollup/rollup-win32-x64-gnu": "4.57.1",
"@rollup/rollup-win32-x64-msvc": "4.57.1",
"fsevents": "~2.3.2"
}
},

View File

@@ -167,7 +167,7 @@
"process_date": "Data proces\u0103rii",
"due_date": "Data scadent\u0103",
"foreign_amount": "Sum\u0103 str\u0103in\u0103",
"payment_date": "Data de plat\u0103",
"payment_date": "Data pl\u0103\u021bii",
"invoice_date": "Data facturii",
"internal_reference": "Referin\u021b\u0103 intern\u0103",
"webhook_response": "R\u0103spuns",