Merge branch 'release/v6.0.7'

This commit is contained in:
James Cole 2023-04-08 08:58:39 +02:00
commit 6535f86001
136 changed files with 3006 additions and 1940 deletions

View File

@ -379,16 +379,16 @@
},
{
"name": "friendsofphp/php-cs-fixer",
"version": "v3.15.1",
"version": "v3.16.0",
"source": {
"type": "git",
"url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git",
"reference": "d48755372a113bddb99f749e34805d83f3acfe04"
"reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d48755372a113bddb99f749e34805d83f3acfe04",
"reference": "d48755372a113bddb99f749e34805d83f3acfe04",
"url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/d40f9436e1c448d309fa995ab9c14c5c7a96f2dc",
"reference": "d40f9436e1c448d309fa995ab9c14c5c7a96f2dc",
"shasum": ""
},
"require": {
@ -463,7 +463,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.15.1"
"source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.16.0"
},
"funding": [
{
@ -471,7 +471,7 @@
"type": "github"
}
],
"time": "2023-03-13T23:26:30+00:00"
"time": "2023-04-02T19:30:06+00:00"
},
{
"name": "psr/cache",

View File

@ -31,6 +31,7 @@ SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
# clean up php code
cd $SCRIPT_DIR/php-cs-fixer
composer update
rm -f .php-cs-fixer.cache
PHP_CS_FIXER_IGNORE_ENV=true ./vendor/bin/php-cs-fixer fix --config $SCRIPT_DIR/php-cs-fixer/.php-cs-fixer.php --allow-risky=yes
cd $SCRIPT_DIR/..

View File

@ -24,7 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Api\V1\Controllers\Models\BudgetLimit;
use FireflyIII\Api\V1\Controllers\Controller;
use FireflyIII\Api\V1\Requests\Data\DateRequest;
use FireflyIII\Api\V1\Requests\Data\SameDateRequest;
use FireflyIII\Exceptions\FireflyException;
use FireflyIII\Models\Budget;
use FireflyIII\Models\BudgetLimit;
@ -108,12 +108,12 @@ class ShowController extends Controller
*
* Display a listing of the budget limits for this budget.
*
* @param DateRequest $request
* @param SameDateRequest $request
*
* @return JsonResponse
* @throws FireflyException
*/
public function indexAll(DateRequest $request): JsonResponse
public function indexAll(SameDateRequest $request): JsonResponse
{
$manager = $this->getManager();
$manager->parseIncludes('budget');

View File

@ -0,0 +1,66 @@
<?php
/*
* DateRequest.php
* Copyright (c) 2021 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/>.
*/
declare(strict_types=1);
namespace FireflyIII\Api\V1\Requests\Data;
use FireflyIII\Support\Request\ChecksLogin;
use FireflyIII\Support\Request\ConvertsDataTypes;
use Illuminate\Foundation\Http\FormRequest;
/**
* Request class for end points that require date parameters.
*
* Class SameDateRequest
*/
class SameDateRequest extends FormRequest
{
use ConvertsDataTypes;
use ChecksLogin;
/**
* Get all data from the request.
*
* @return array
*/
public function getAll(): array
{
return [
'start' => $this->getCarbonDate('start'),
'end' => $this->getCarbonDate('end'),
];
}
/**
* The rules that the incoming request must be matched against.
*
* @return array
*/
public function rules(): array
{
return [
'start' => 'required|date',
'end' => 'required|date|after_or_equal:start',
];
}
}

View File

@ -0,0 +1,74 @@
<?php
declare(strict_types=1);
namespace FireflyIII\Console\Commands;
use FireflyIII\Exceptions\FireflyException;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
class ForceMigration extends Command
{
use VerifiesAccessToken;
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'firefly-iii:force-migrations
{--user=1 : The user ID.}
{--token= : The user\'s access token.}';
/**
* The console command description.
*
* @var string
*/
protected $description = 'This command will force-run all database migrations.';
/**
* Execute the console command.
* @throws FireflyException
*/
public function handle(): int
{
if (!$this->verifyAccessToken()) {
$this->error('Invalid access token.');
return 1;
}
$this->error('Running this command is dangerous and can cause data loss.');
$this->error('Please do not continue.');
$question = $this->confirm('Do you want to continue?');
if (true === $question) {
$user = $this->getUser();
Log::channel('audit')->info(sprintf('User #%d ("%s") forced migrations.', $user->id, $user->email));
$this->forceMigration();
return 0;
}
return 0;
}
private function forceMigration(): void
{
$this->line('Dropping "migrations" table...');
sleep(2);
Schema::dropIfExists('migrations');
$this->line('Done!');
$this->line('Re-run all migrations...');
Artisan::call('migrate', ['--seed' => true]);
sleep(2);
$this->line('');
$this->info('Done!');
$this->line('There is a good chance you just saw a lot of error messages.');
$this->line('No need to panic yet. First try to access Firefly III (again).');
$this->line('The issue, whatever it was, may have been solved now.');
$this->line('');
}
}

View File

@ -78,7 +78,7 @@ class NetWorth implements NetWorthInterface
$netWorth = [];
$result = [];
// Log::debug(sprintf('Now in getNetWorthByCurrency(%s)', $date->format('Y-m-d')));
// Log::debug(sprintf('Now in getNetWorthByCurrency(%s)', $date->format('Y-m-d')));
// get default currency
$default = app('amount')->getDefaultCurrencyByUser($this->user);
@ -89,11 +89,11 @@ class NetWorth implements NetWorthInterface
// get the preferred currency for this account
/** @var Account $account */
foreach ($accounts as $account) {
// Log::debug(sprintf('Now at account #%d: "%s"', $account->id, $account->name));
// Log::debug(sprintf('Now at account #%d: "%s"', $account->id, $account->name));
$currencyId = (int)$this->accountRepository->getMetaValue($account, 'currency_id');
$currencyId = 0 === $currencyId ? $default->id : $currencyId;
// Log::debug(sprintf('Currency ID is #%d', $currencyId));
// Log::debug(sprintf('Currency ID is #%d', $currencyId));
// balance in array:
$balance = $balances[$account->id] ?? '0';
@ -106,13 +106,13 @@ class NetWorth implements NetWorthInterface
$balance = bcsub($balance, $virtualBalance);
}
// Log::debug(sprintf('Balance corrected to %s because of virtual balance (%s)', $balance, $virtualBalance));
// Log::debug(sprintf('Balance corrected to %s because of virtual balance (%s)', $balance, $virtualBalance));
if (!array_key_exists($currencyId, $netWorth)) {
$netWorth[$currencyId] = '0';
}
$netWorth[$currencyId] = bcadd($balance, $netWorth[$currencyId]);
// Log::debug(sprintf('Total net worth for currency #%d is %s', $currencyId, $netWorth[$currencyId]));
// Log::debug(sprintf('Total net worth for currency #%d is %s', $currencyId, $netWorth[$currencyId]));
}
ksort($netWorth);

View File

@ -100,11 +100,12 @@ abstract class Controller extends BaseController
$this->monthFormat = (string)trans('config.month_js', [], $locale);
$this->monthAndDayFormat = (string)trans('config.month_and_day_js', [], $locale);
$this->dateTimeFormat = (string)trans('config.date_time_js', [], $locale);
$darkMode = 'browser';
// get shown-intro-preference:
if (auth()->check()) {
$language = app('steam')->getLanguage();
$locale = app('steam')->getLocale();
$darkMode = app('preferences')->get('darkMode', 'browser')->data;
$page = $this->getPageName();
$shownDemo = $this->hasSeenDemo();
app('view')->share('language', $language);
@ -113,6 +114,7 @@ abstract class Controller extends BaseController
app('view')->share('current_route_name', $page);
app('view')->share('original_route_name', Route::currentRouteName());
}
app('view')->share('darkMode', $darkMode);
return $next($request);
}

View File

@ -24,6 +24,7 @@ declare(strict_types=1);
namespace FireflyIII\Http\Controllers;
use Carbon\Carbon;
use Carbon\Exceptions\InvalidFormatException;
use Exception;
use FireflyIII\Events\RequestedVersionCheckStatus;
use FireflyIII\Exceptions\FireflyException;
@ -66,12 +67,24 @@ class HomeController extends Controller
*/
public function dateRange(Request $request): JsonResponse
{
$start = new Carbon($request->get('start'));
$end = new Carbon($request->get('end'));
try {
$stringStart = e((string)$request->get('start'));
$start = Carbon::createFromFormat('Y-m-d', $stringStart);
} catch (InvalidFormatException $e) {
Log::error(sprintf('Start: could not parse date string "%s" so ignore it.', $stringStart));
$start = Carbon::now()->startOfMonth();
}
try {
$stringEnd = e((string)$request->get('end'));
$end = Carbon::createFromFormat('Y-m-d', $stringEnd);
} catch (InvalidFormatException $e) {
Log::error(sprintf('End could not parse date string "%s" so ignore it.', $stringEnd));
$end = Carbon::now()->endOfMonth();
}
$label = $request->get('label');
$isCustomRange = false;
Log::debug('Received dateRange', ['start' => $request->get('start'), 'end' => $request->get('end'), 'label' => $request->get('label')]);
Log::debug('Received dateRange', ['start' => $stringStart, 'end' => $stringEnd, 'label' => $request->get('label')]);
// check if the label is "everything" or "Custom range" which will betray
// a possible problem with the budgets.
if ($label === (string)trans('firefly.everything') || $label === (string)trans('firefly.customRange')) {

View File

@ -32,9 +32,9 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Routing\Redirector;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use JsonException;
use Illuminate\Support\Facades\Log;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
@ -102,14 +102,15 @@ class PreferencesController extends Controller
$languages = config('firefly.languages');
$locale = app('preferences')->get('locale', config('firefly.default_locale', 'equal'))->data;
$listPageSize = app('preferences')->get('listPageSize', 50)->data;
$darkMode = app('preferences')->get('darkMode', 'browser')->data;
$slackUrl = app('preferences')->get('slack_webhook_url', '')->data;
$customFiscalYear = app('preferences')->get('customFiscalYear', 0)->data;
$fiscalYearStartStr = app('preferences')->get('fiscalYearStart', '01-01')->data;
$fiscalYearStart = date('Y').'-'.$fiscalYearStartStr;
$tjOptionalFields = app('preferences')->get('transaction_journal_optional_fields', [])->data;
$availableDarkModes = config('firefly.available_dark_modes');
// notification preferences (single value for each):
$notifications = [];
foreach (config('firefly.available_notifications') as $notification) {
$notifications[$notification] = app('preferences')->get(sprintf('notification_%s', $notification), true)->data;
@ -140,6 +141,8 @@ class PreferencesController extends Controller
'isDocker',
'frontPageAccounts',
'languages',
'darkMode',
'availableDarkModes',
'notifications',
'slackUrl',
'locales',
@ -257,6 +260,12 @@ class PreferencesController extends Controller
];
app('preferences')->set('transaction_journal_optional_fields', $optionalTj);
// dark mode
$darkMode = $request->get('darkMode') ?? 'browser';
if(in_array($darkMode, config('firefly.available_dark_modes'), true)) {
app('preferences')->set('darkMode', $darkMode);
}
session()->flash('success', (string)trans('firefly.saved_preferences'));
app('preferences')->mark();

View File

@ -38,8 +38,8 @@ use Illuminate\Contracts\View\Factory;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\RedirectResponse;
use Illuminate\Support\Collection;
use Illuminate\View\View;
use Illuminate\Support\Facades\Log;
use Illuminate\View\View;
use Throwable;
/**
@ -150,9 +150,13 @@ class SelectController extends Controller
}
foreach ($textTriggers as $textTrigger) {
$trigger = new RuleTrigger();
$trigger->trigger_type = $textTrigger['type'];
$trigger->trigger_value = $textTrigger['value'];
$trigger = new RuleTrigger();
$trigger->trigger_type = $textTrigger['type'];
$trigger->trigger_value = $textTrigger['value'];
$trigger->stop_processing = $textTrigger['stop_processing'];
if ($textTrigger['prohibited']) {
$trigger->trigger_type = sprintf('-%s', $textTrigger['type']);
}
$triggers->push($trigger);
}

View File

@ -45,8 +45,8 @@ class AcceptHeaders
public function handle($request, $next): mixed
{
$method = $request->getMethod();
$accepts = ['application/x-www-form-urlencoded', 'application/json', 'application/vnd.api+json', '*/*'];
$contentTypes = ['application/x-www-form-urlencoded', 'application/json', 'application/vnd.api+json'];
$accepts = ['application/x-www-form-urlencoded', 'application/json', 'application/vnd.api+json', 'application/octet-stream', '*/*'];
$contentTypes = ['application/x-www-form-urlencoded', 'application/json', 'application/vnd.api+json', 'application/octet-stream'];
$submitted = (string)$request->header('Content-Type');

View File

@ -49,6 +49,9 @@ use Illuminate\Support\Carbon;
* @method static Builder|UserGroup whereId($value)
* @method static Builder|UserGroup whereTitle($value)
* @method static Builder|UserGroup whereUpdatedAt($value)
* @property-read Collection<int, \FireflyIII\Models\Account> $accounts
* @property-read int|null $accounts_count
* @property-read Collection<int, \FireflyIII\Models\Account> $accounts
* @mixin Eloquent
*/
class UserGroup extends Model

View File

@ -178,7 +178,7 @@ trait ModifiesPiggyBanks
return $piggyBank;
}
$max = $piggyBank->targetamount;
if (1 === bccomp($amount, $max)) {
if (1 === bccomp($amount, $max) && 0 !== bccomp($piggyBank->targetamount, '0')) {
$amount = $max;
}
$difference = bcsub($amount, $repetition->currentamount);

View File

@ -34,7 +34,6 @@ use Throwable;
/**
* Class ExpandedForm.
*
* @SuppressWarnings(PHPMD.TooManyMethods)
*
*/

View File

@ -33,9 +33,9 @@ use FireflyIII\User;
use Hash;
use Illuminate\Contracts\Validation\Validator as ValidatorContract;
use Illuminate\Routing\Route;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Validator;
use InvalidArgumentException;
use Illuminate\Support\Facades\Log;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Route as RouteFacade;
@ -75,6 +75,7 @@ trait RequestInformation
$current = [
'type' => $triggerInfo['type'] ?? '',
'value' => $triggerInfo['value'] ?? '',
'prohibited' => $triggerInfo['prohibited'] ?? false,
'stop_processing' => 1 === (int)($triggerInfo['stop_processing'] ?? '0'),
];
$current = RuleFormRequest::replaceAmountTrigger($current);

View File

@ -263,9 +263,9 @@ class OperatorQuerySearch implements SearchInterface
Log::info(sprintf('Ignore search operator "%s"', $operator));
return false;
//
//
// all account related searches:
//
//
case 'account_is':
$this->searchAccount($value, 3, 4);
break;
@ -496,9 +496,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->findNothing();
}
break;
//
//
// cash account
//
//
case 'source_is_cash':
$account = $this->getCashAccount();
$this->collector->setSourceAccounts(new Collection([$account]));
@ -523,9 +523,9 @@ class OperatorQuerySearch implements SearchInterface
$account = $this->getCashAccount();
$this->collector->excludeAccounts(new Collection([$account]));
break;
//
//
// description
//
//
case 'description_starts':
$this->collector->descriptionStarts([$value]);
break;
@ -552,9 +552,9 @@ class OperatorQuerySearch implements SearchInterface
case '-description_is':
$this->collector->descriptionIsNot($value);
break;
//
//
// currency
//
//
case 'currency_is':
$currency = $this->findCurrency($value);
if (null !== $currency) {
@ -591,9 +591,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->findNothing();
}
break;
//
//
// attachments
//
//
case 'has_attachments':
case '-has_no_attachments':
Log::debug('Set collector to filter on attachments.');
@ -604,7 +604,7 @@ class OperatorQuerySearch implements SearchInterface
Log::debug('Set collector to filter on NO attachments.');
$this->collector->hasNoAttachments();
break;
//
//
// categories
case '-has_any_category':
case 'has_no_category':
@ -683,9 +683,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->findNothing();
}
break;
//
//
// budgets
//
//
case '-has_any_budget':
case 'has_no_budget':
$this->collector->withoutBudget();
@ -764,9 +764,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->findNothing();
}
break;
//
//
// bill
//
//
case '-has_any_bill':
case 'has_no_bill':
$this->collector->withoutBill();
@ -843,9 +843,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->findNothing();
}
break;
//
//
// tags
//
//
case '-has_any_tag':
case 'has_no_tag':
$this->collector->withoutTags();
@ -873,9 +873,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->setWithoutSpecificTags($result);
}
break;
//
//
// notes
//
//
case 'notes_contains':
$this->collector->notesContain($value);
break;
@ -914,9 +914,9 @@ class OperatorQuerySearch implements SearchInterface
case '-reconciled':
$this->collector->isNotReconciled();
break;
//
//
// amount
//
//
case 'amount_is':
// strip comma's, make dots.
Log::debug(sprintf('Original value "%s"', $value));
@ -987,9 +987,9 @@ class OperatorQuerySearch implements SearchInterface
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $amount));
$this->collector->foreignAmountMore($amount);
break;
//
//
// transaction type
//
//
case 'transaction_type':
$this->collector->setTypes([ucfirst($value)]);
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
@ -998,9 +998,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->excludeTypes([ucfirst($value)]);
Log::debug(sprintf('Set "%s" using collector with value "%s"', $operator, $value));
break;
//
//
// dates
//
//
case '-date_on':
case 'date_on':
$range = $this->parseDateRange($value);
@ -1150,9 +1150,9 @@ class OperatorQuerySearch implements SearchInterface
$range = $this->parseDateRange($value);
$this->setObjectDateAfterParams('updated_at', $range);
return false;
//
//
// external URL
//
//
case '-any_external_url':
case 'no_external_url':
$this->collector->withoutExternalUrl();
@ -1195,9 +1195,9 @@ class OperatorQuerySearch implements SearchInterface
$this->collector->externalUrlDoesNotEnd($value);
break;
//
//
// other fields
//
//
case 'external_id_is':
$this->collector->setExternalId($value);
break;

View File

@ -67,11 +67,11 @@ class BudgetLimitTransformer extends AbstractTransformer
*/
public function transform(BudgetLimit $budgetLimit): array
{
// $repository = app(OperationsRepository::class);
// $repository->setUser($budgetLimit->budget->user);
// $expenses = $repository->sumExpenses(
// $budgetLimit->start_date, $budgetLimit->end_date, null, new Collection([$budgetLimit->budget]), $budgetLimit->transactionCurrency
// );
// $repository = app(OperationsRepository::class);
// $repository->setUser($budgetLimit->budget->user);
// $expenses = $repository->sumExpenses(
// $budgetLimit->start_date, $budgetLimit->end_date, null, new Collection([$budgetLimit->budget]), $budgetLimit->transactionCurrency
// );
$currency = $budgetLimit->transactionCurrency;
$amount = $budgetLimit->amount;
$currencyDecimalPlaces = 2;

View File

@ -68,30 +68,30 @@ class BudgetTransformer extends AbstractTransformer
$start = $this->parameters->get('start');
$end = $this->parameters->get('end');
//$autoBudget = $this->repository->getAutoBudget($budget);
// $spent = [];
// if (null !== $start && null !== $end) {
// $spent = $this->beautify($this->opsRepository->sumExpenses($start, $end, null, new Collection([$budget])));
// }
// $spent = [];
// if (null !== $start && null !== $end) {
// $spent = $this->beautify($this->opsRepository->sumExpenses($start, $end, null, new Collection([$budget])));
// }
// $abCurrencyId = null;
// $abCurrencyCode = null;
// $abType = null;
// $abAmount = null;
// $abPeriod = null;
// $notes = $this->repository->getNoteText($budget);
//
// $types = [
// AutoBudget::AUTO_BUDGET_RESET => 'reset',
// AutoBudget::AUTO_BUDGET_ROLLOVER => 'rollover',
// ];
//
// if (null !== $autoBudget) {
// $abCurrencyId = (string) $autoBudget->transactionCurrency->id;
// $abCurrencyCode = $autoBudget->transactionCurrency->code;
// $abType = $types[$autoBudget->auto_budget_type];
// $abAmount = number_format((float) $autoBudget->amount, $autoBudget->transactionCurrency->decimal_places, '.', '');
// $abPeriod = $autoBudget->period;
// }
// $abCurrencyId = null;
// $abCurrencyCode = null;
// $abType = null;
// $abAmount = null;
// $abPeriod = null;
// $notes = $this->repository->getNoteText($budget);
//
// $types = [
// AutoBudget::AUTO_BUDGET_RESET => 'reset',
// AutoBudget::AUTO_BUDGET_ROLLOVER => 'rollover',
// ];
//
// if (null !== $autoBudget) {
// $abCurrencyId = (string) $autoBudget->transactionCurrency->id;
// $abCurrencyCode = $autoBudget->transactionCurrency->code;
// $abType = $types[$autoBudget->auto_budget_type];
// $abAmount = number_format((float) $autoBudget->amount, $autoBudget->transactionCurrency->decimal_places, '.', '');
// $abPeriod = $autoBudget->period;
// }
return [
'id' => (string)$budget->id,

View File

@ -165,7 +165,6 @@ trait GroupValidation
* @param array $transaction
* @param TransactionGroup $transactionGroup
*
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
*/
private function validateJournalId(Validator $validator, int $index, array $transaction, TransactionGroup $transactionGroup): void
{

View File

@ -2,6 +2,22 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
## v6.0.7 - 2023-04-09
### Added
- Lots of error catching in DB migrations for smoother upgrades.
- New command `firefly-iii:force-migration` which will force database migrations to run. It will probably also destroy your database so don't use it.
- You can now force light/dark mode in your settings.
### Fixed
- [Issue 7137](https://github.com/firefly-iii/firefly-iii/issues/7137) Inconsistent rule test form
- [Issue 7320](https://github.com/firefly-iii/firefly-iii/issues/7320) Standard email values so less errors
- [Issue 7311](https://github.com/firefly-iii/firefly-iii/issues/7311) Fix issue with date validation
- [Issue 7310](https://github.com/firefly-iii/firefly-iii/issues/7310) Better color contrast in dark mode.
### API
- [Issue 7308](https://github.com/firefly-iii/firefly-iii/issues/7308) Could not set current amount for certain piggy banks
## v6.0.6 - 2023-04-02
### Changed
@ -20,6 +36,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
### API
- Fixed: Could not give piggy bank an unlimited amount.
- [Issue 7335](https://github.com/firefly-iii/firefly-iii/issues/7335) Fix upload of attachments, thanks @fengkaijia
## v6.0.5 - 2023-03-19

136
composer.lock generated
View File

@ -1944,16 +1944,16 @@
},
{
"name": "laravel/framework",
"version": "v10.5.1",
"version": "v10.6.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "485f22333e8c1dff5bae0fe0421c1e2e139713de"
"reference": "13dc93889617427352f72b6aa8b195b252af1197"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/485f22333e8c1dff5bae0fe0421c1e2e139713de",
"reference": "485f22333e8c1dff5bae0fe0421c1e2e139713de",
"url": "https://api.github.com/repos/laravel/framework/zipball/13dc93889617427352f72b6aa8b195b252af1197",
"reference": "13dc93889617427352f72b6aa8b195b252af1197",
"shasum": ""
},
"require": {
@ -2052,7 +2052,7 @@
"league/flysystem-read-only": "^3.3",
"league/flysystem-sftp-v3": "^3.0",
"mockery/mockery": "^1.5.1",
"orchestra/testbench-core": "^8.1",
"orchestra/testbench-core": "^8.4",
"pda/pheanstalk": "^4.0",
"phpstan/phpdoc-parser": "^1.15",
"phpstan/phpstan": "^1.4.7",
@ -2140,25 +2140,25 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-03-29T15:09:16+00:00"
"time": "2023-04-05T15:28:17+00:00"
},
{
"name": "laravel/passport",
"version": "v11.8.4",
"version": "v11.8.5",
"source": {
"type": "git",
"url": "https://github.com/laravel/passport.git",
"reference": "b6b68fad1d02e39c6c659705159487f643393cdd"
"reference": "5417fe870a1a76628c13c79ce4c9b6fbea429bc0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/passport/zipball/b6b68fad1d02e39c6c659705159487f643393cdd",
"reference": "b6b68fad1d02e39c6c659705159487f643393cdd",
"url": "https://api.github.com/repos/laravel/passport/zipball/5417fe870a1a76628c13c79ce4c9b6fbea429bc0",
"reference": "5417fe870a1a76628c13c79ce4c9b6fbea429bc0",
"shasum": ""
},
"require": {
"ext-json": "*",
"firebase/php-jwt": "^6.3.1",
"firebase/php-jwt": "^6.4",
"illuminate/auth": "^9.0|^10.0",
"illuminate/console": "^9.0|^10.0",
"illuminate/container": "^9.0|^10.0",
@ -2168,12 +2168,12 @@
"illuminate/encryption": "^9.0|^10.0",
"illuminate/http": "^9.0|^10.0",
"illuminate/support": "^9.0|^10.0",
"lcobucci/jwt": "^3.4|^4.0",
"league/oauth2-server": "^8.2",
"nyholm/psr7": "^1.3",
"lcobucci/jwt": "^4.3|^5.0",
"league/oauth2-server": "^8.5.1",
"nyholm/psr7": "^1.5",
"php": "^8.0",
"phpseclib/phpseclib": "^2.0|^3.0",
"symfony/psr-http-message-bridge": "^2.0"
"symfony/psr-http-message-bridge": "^2.1"
},
"require-dev": {
"mockery/mockery": "^1.0",
@ -2218,7 +2218,7 @@
"issues": "https://github.com/laravel/passport/issues",
"source": "https://github.com/laravel/passport"
},
"time": "2023-03-18T18:55:20+00:00"
"time": "2023-04-04T14:06:53+00:00"
},
{
"name": "laravel/sanctum",
@ -2606,39 +2606,40 @@
},
{
"name": "lcobucci/jwt",
"version": "4.3.0",
"version": "5.0.0",
"source": {
"type": "git",
"url": "https://github.com/lcobucci/jwt.git",
"reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4"
"reference": "47bdb0e0b5d00c2f89ebe33e7e384c77e84e7c34"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/4d7de2fe0d51a96418c0d04004986e410e87f6b4",
"reference": "4d7de2fe0d51a96418c0d04004986e410e87f6b4",
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/47bdb0e0b5d00c2f89ebe33e7e384c77e84e7c34",
"reference": "47bdb0e0b5d00c2f89ebe33e7e384c77e84e7c34",
"shasum": ""
},
"require": {
"ext-hash": "*",
"ext-json": "*",
"ext-mbstring": "*",
"ext-openssl": "*",
"ext-sodium": "*",
"lcobucci/clock": "^2.0 || ^3.0",
"php": "^7.4 || ^8.0"
"php": "~8.1.0 || ~8.2.0",
"psr/clock": "^1.0"
},
"require-dev": {
"infection/infection": "^0.21",
"lcobucci/coding-standard": "^6.0",
"mikey179/vfsstream": "^1.6.7",
"phpbench/phpbench": "^1.2",
"phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^1.4",
"phpstan/phpstan-deprecation-rules": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/php-invoker": "^3.1",
"phpunit/phpunit": "^9.5"
"infection/infection": "^0.26.19",
"lcobucci/clock": "^3.0",
"lcobucci/coding-standard": "^9.0",
"phpbench/phpbench": "^1.2.8",
"phpstan/extension-installer": "^1.2",
"phpstan/phpstan": "^1.10.3",
"phpstan/phpstan-deprecation-rules": "^1.1.2",
"phpstan/phpstan-phpunit": "^1.3.8",
"phpstan/phpstan-strict-rules": "^1.5.0",
"phpunit/phpunit": "^10.0.12"
},
"suggest": {
"lcobucci/clock": ">= 3.0"
},
"type": "library",
"autoload": {
@ -2664,7 +2665,7 @@
],
"support": {
"issues": "https://github.com/lcobucci/jwt/issues",
"source": "https://github.com/lcobucci/jwt/tree/4.3.0"
"source": "https://github.com/lcobucci/jwt/tree/5.0.0"
},
"funding": [
{
@ -2676,7 +2677,7 @@
"type": "patreon"
}
],
"time": "2023-01-02T13:28:00+00:00"
"time": "2023-02-25T21:35:16+00:00"
},
{
"name": "league/commonmark",
@ -3226,26 +3227,27 @@
},
{
"name": "league/oauth2-server",
"version": "8.4.1",
"version": "8.5.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/oauth2-server.git",
"reference": "eed31d86d8cc8e6e9c9f58fbb2113494f8b41e24"
"reference": "43cd4d406906c6be5c8de2cee9bd3ad3753544ef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/eed31d86d8cc8e6e9c9f58fbb2113494f8b41e24",
"reference": "eed31d86d8cc8e6e9c9f58fbb2113494f8b41e24",
"url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/43cd4d406906c6be5c8de2cee9bd3ad3753544ef",
"reference": "43cd4d406906c6be5c8de2cee9bd3ad3753544ef",
"shasum": ""
},
"require": {
"defuse/php-encryption": "^2.2.1",
"defuse/php-encryption": "^2.3",
"ext-json": "*",
"ext-openssl": "*",
"lcobucci/jwt": "^3.4.6 || ^4.0.4",
"lcobucci/clock": "^2.2 || ^3.0",
"lcobucci/jwt": "^4.3 || ^5.0",
"league/event": "^2.2",
"league/uri": "^6.4",
"php": "^7.2 || ^8.0",
"league/uri": "^6.7",
"php": "^8.0",
"psr/http-message": "^1.0.1"
},
"replace": {
@ -3253,10 +3255,10 @@
"lncd/oauth2": "*"
},
"require-dev": {
"laminas/laminas-diactoros": "^2.4.1",
"laminas/laminas-diactoros": "^2.24.0",
"phpstan/phpstan": "^0.12.57",
"phpstan/phpstan-phpunit": "^0.12.16",
"phpunit/phpunit": "^8.5.13",
"phpunit/phpunit": "^9.6.6",
"roave/security-advisories": "dev-master"
},
"type": "library",
@ -3302,7 +3304,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/oauth2-server/issues",
"source": "https://github.com/thephpleague/oauth2-server/tree/8.4.1"
"source": "https://github.com/thephpleague/oauth2-server/tree/8.5.1"
},
"funding": [
{
@ -3310,7 +3312,7 @@
"type": "github"
}
],
"time": "2023-03-22T11:47:53+00:00"
"time": "2023-04-04T10:20:16+00:00"
},
{
"name": "league/uri",
@ -5052,25 +5054,25 @@
},
{
"name": "psr/http-message",
"version": "1.0.1",
"version": "1.1",
"source": {
"type": "git",
"url": "https://github.com/php-fig/http-message.git",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363"
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363",
"reference": "f6561bf28d520154e4b0ec72be95418abe6d9363",
"url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
"php": "^7.2 || ^8.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "1.1.x-dev"
}
},
"autoload": {
@ -5099,9 +5101,9 @@
"response"
],
"support": {
"source": "https://github.com/php-fig/http-message/tree/master"
"source": "https://github.com/php-fig/http-message/tree/1.1"
},
"time": "2016-08-06T14:39:51+00:00"
"time": "2023-04-04T09:50:52+00:00"
},
{
"name": "psr/log",
@ -9806,16 +9808,16 @@
},
{
"name": "phpstan/phpdoc-parser",
"version": "1.16.1",
"version": "1.18.1",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571"
"reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/e27e92d939e2e3636f0a1f0afaba59692c0bf571",
"reference": "e27e92d939e2e3636f0a1f0afaba59692c0bf571",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/22dcdfd725ddf99583bfe398fc624ad6c5004a0f",
"reference": "22dcdfd725ddf99583bfe398fc624ad6c5004a0f",
"shasum": ""
},
"require": {
@ -9845,22 +9847,22 @@
"description": "PHPDoc parser with support for nullable, intersection and generic types",
"support": {
"issues": "https://github.com/phpstan/phpdoc-parser/issues",
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.16.1"
"source": "https://github.com/phpstan/phpdoc-parser/tree/1.18.1"
},
"time": "2023-02-07T18:11:17+00:00"
"time": "2023-04-07T11:51:11+00:00"
},
{
"name": "phpstan/phpstan",
"version": "1.10.9",
"version": "1.10.11",
"source": {
"type": "git",
"url": "https://github.com/phpstan/phpstan.git",
"reference": "9b13dafe3d66693d20fe5729c3dde1d31bb64703"
"reference": "8aa62e6ea8b58ffb650e02940e55a788cbc3fe21"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/9b13dafe3d66693d20fe5729c3dde1d31bb64703",
"reference": "9b13dafe3d66693d20fe5729c3dde1d31bb64703",
"url": "https://api.github.com/repos/phpstan/phpstan/zipball/8aa62e6ea8b58ffb650e02940e55a788cbc3fe21",
"reference": "8aa62e6ea8b58ffb650e02940e55a788cbc3fe21",
"shasum": ""
},
"require": {
@ -9909,7 +9911,7 @@
"type": "tidelift"
}
],
"time": "2023-03-30T08:58:01+00:00"
"time": "2023-04-04T19:17:42+00:00"
},
{
"name": "phpstan/phpstan-deprecation-rules",

View File

@ -107,7 +107,7 @@ return [
'webhooks' => true,
'handle_debts' => true,
],
'version' => '6.0.6',
'version' => '6.0.7',
'api_version' => '2.0.1',
'db_version' => 19,
@ -205,6 +205,7 @@ return [
],
// default user-related values
'darkMode' => 'browser',
'list_length' => 10, // to be removed if v1 is cancelled.
'default_preferences' => [
'frontPageAccounts' => [],
@ -241,6 +242,7 @@ return [
TransactionJournal::class,
Recurrence::class,
],
'available_dark_modes' => ['light', 'dark', 'browser'],
'bill_reminder_periods' => [90, 30, 14, 7, 0],
'valid_view_ranges' => ['1D', '1W', '1M', '3M', '6M', '1Y',],
'allowedMimes' => [

View File

@ -38,11 +38,11 @@ return [
'mailers' => [
'smtp' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST', 'smtp.mailtrap.io'),
'host' => envNonEmpty('MAIL_HOST', 'smtp.mailtrap.io'),
'port' => (int)env('MAIL_PORT', 2525),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'encryption' => envNonEmpty('MAIL_ENCRYPTION', 'tls'),
'username' => envNonEmpty('MAIL_USERNAME', 'user@example.com'),
'password' => envNonEmpty('MAIL_PASSWORD', 'password'),
'timeout' => null,
'verify_peer' => null !== env('MAIL_ENCRYPTION'),
],
@ -72,6 +72,11 @@ return [
'channel' => env('MAIL_LOG_CHANNEL', 'stack'),
'level' => 'notice',
],
'null' => [
'transport' => 'log',
'channel' => env('MAIL_LOG_CHANNEL', 'stack'),
'level' => 'notice',
],
'array' => [
'transport' => 'array',

View File

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -51,7 +52,6 @@ class CreateSupportTables extends Migration
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
@ -67,177 +67,257 @@ class CreateSupportTables extends Migration
$this->createConfigurationTable();
}
/**
* @return void
*/
private function createAccountTypeTable(): void
{
if (!Schema::hasTable('account_types')) {
Schema::create(
'account_types',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('type', 50);
try {
Schema::create(
'account_types',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('type', 50);
// type must be unique.
$table->unique(['type']);
}
);
}
}
private function createCurrencyTable(): void
{
if (!Schema::hasTable('transaction_currencies')) {
Schema::create(
'transaction_currencies',
static function (Blueprint $table) {
$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']);
}
);
}
}
private function createTransactionTypeTable(): void
{
if (!Schema::hasTable('transaction_types')) {
Schema::create(
'transaction_types',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('type', 50);
// type must be unique.
$table->unique(['type']);
}
);
}
}
private function createJobsTable(): void
{
if (!Schema::hasTable('jobs')) {
Schema::create(
'jobs',
static function (Blueprint $table) {
// 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']);
}
);
}
}
private function createPasswordTable(): void
{
if (!Schema::hasTable('password_resets')) {
Schema::create(
'password_resets',
static function (Blueprint $table) {
// straight from laravel
$table->string('email')->index();
$table->string('token')->index();
$table->timestamp('created_at')->nullable();
}
);
}
}
private function createPermissionsTable(): void
{
if (!Schema::hasTable('permissions')) {
Schema::create(
'permissions',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
}
);
}
}
private function createRolesTable(): void
{
if (!Schema::hasTable('roles')) {
Schema::create(
'roles',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
}
);
}
}
private function createPermissionRoleTable(): void
{
if (!Schema::hasTable('permission_role')) {
Schema::create(
'permission_role',
static function (Blueprint $table) {
$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->primary(['permission_id', 'role_id']);
}
);
}
}
private function createSessionsTable(): void
{
if (!Schema::hasTable('sessions')) {
Schema::create(
'sessions',
static function (Blueprint $table) {
$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');
}
);
// type must be unique.
$table->unique(['type']);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "account_types": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createConfigurationTable(): void
{
if (!Schema::hasTable('configuration')) {
Schema::create(
'configuration',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('name', 50);
$table->text('data');
}
);
try {
Schema::create(
'configuration',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('name', 50);
$table->text('data');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "configuration": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createCurrencyTable(): void
{
if (!Schema::hasTable('transaction_currencies')) {
try {
Schema::create(
'transaction_currencies',
static function (Blueprint $table) {
$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']);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "transaction_currencies": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createJobsTable(): void
{
if (!Schema::hasTable('jobs')) {
try {
Schema::create(
'jobs',
static function (Blueprint $table) {
// 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) {
Log::error(sprintf('Could not create table "jobs": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createPasswordTable(): void
{
if (!Schema::hasTable('password_resets')) {
try {
Schema::create(
'password_resets',
static function (Blueprint $table) {
// straight from laravel
$table->string('email')->index();
$table->string('token')->index();
$table->timestamp('created_at')->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "password_resets": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createPermissionRoleTable(): void
{
if (!Schema::hasTable('permission_role')) {
try {
Schema::create(
'permission_role',
static function (Blueprint $table) {
$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->primary(['permission_id', 'role_id']);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "permission_role": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createPermissionsTable(): void
{
if (!Schema::hasTable('permissions')) {
try {
Schema::create(
'permissions',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "permissions": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createRolesTable(): void
{
if (!Schema::hasTable('roles')) {
try {
Schema::create(
'roles',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('name')->unique();
$table->string('display_name')->nullable();
$table->string('description')->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "roles": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createSessionsTable(): void
{
if (!Schema::hasTable('sessions')) {
try {
Schema::create(
'sessions',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "sessions": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
/**
* @return void
*/
private function createTransactionTypeTable(): void
{
if (!Schema::hasTable('transaction_types')) {
try {
Schema::create(
'transaction_types',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('type', 50);
// type must be unique.
$table->unique(['type']);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "transaction_types": %s', $e->getMessage()));
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

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -42,24 +43,28 @@ class CreateUsersTable extends Migration
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
if (!Schema::hasTable('users')) {
Schema::create(
'users',
static function (Blueprint $table) {
$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();
}
);
try {
Schema::create(
'users',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "users": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -22,7 +22,6 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesFor3101.
@ -36,30 +35,13 @@ class ChangesFor3101 extends Migration
*/
public function down(): void
{
Schema::table(
'import_jobs',
static function (Blueprint $table) {
if (Schema::hasColumn('import_jobs', 'extended_status')) {
$table->dropColumn('extended_status');
}
}
);
}
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::table(
'import_jobs',
static function (Blueprint $table) {
if (!Schema::hasColumn('import_jobs', 'extended_status')) {
$table->text('extended_status')->nullable();
}
}
);
}
}

View File

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -41,22 +42,31 @@ class FixNullables extends Migration
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::table(
'rule_groups',
static function (Blueprint $table) {
$table->text('description')->nullable()->change();
}
);
try {
Schema::table(
'rule_groups',
static function (Blueprint $table) {
$table->text('description')->nullable()->change();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not update table: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'rules',
static function (Blueprint $table) {
$table->text('description')->nullable()->change();
}
);
try {
Schema::table(
'rules',
static function (Blueprint $table) {
$table->text('description')->nullable()->change();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -21,7 +21,9 @@
*/
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -36,26 +38,35 @@ class ExpandTransactionsTable extends Migration
*/
public function down(): void
{
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->dropColumn('identifier');
}
);
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->dropColumn('identifier');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not drop column "extended_status": %s', $e->getMessage()));
Log::error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->smallInteger('identifier', false, true)->default(0);
}
);
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->smallInteger('identifier', false, true)->default(0);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -42,21 +43,25 @@ class ChangesForV410 extends Migration
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::create(
'notes',
static function (Blueprint $table) {
$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();
}
);
try {
Schema::create(
'notes',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "notes": %s', $e->getMessage()));
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

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -36,26 +37,35 @@ class ChangesForV420 extends Migration
*/
public function down(): void
{
Schema::table(
'journal_meta',
static function (Blueprint $table) {
$table->dropSoftDeletes();
}
);
try {
Schema::table(
'journal_meta',
static function (Blueprint $table) {
$table->dropSoftDeletes();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::table(
'journal_meta',
static function (Blueprint $table) {
$table->softDeletes();
}
);
try {
Schema::table(
'journal_meta',
static function (Blueprint $table) {
$table->softDeletes();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -42,25 +43,29 @@ class ChangesForV430 extends Migration
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::create(
'available_budgets',
static function (Blueprint $table) {
$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');
try {
Schema::create(
'available_budgets',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "available_budgets": %s', $e->getMessage()));
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

@ -21,7 +21,9 @@
*/
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -37,87 +39,135 @@ class ChangesForV431 extends Migration
public function down(): void
{
// reinstate "repeats" and "repeat_freq".
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->string('repeat_freq', 30)->nullable();
}
);
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->boolean('repeats')->default(0);
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->string('repeat_freq', 30)->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'budget_limits',
static function (Blueprint $table) {
$table->boolean('repeats')->default(0);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// change field "start_date" to "startdate"
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->renameColumn('start_date', 'startdate');
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->renameColumn('start_date', 'startdate');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// remove date field "end_date"
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('end_date');
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('end_date');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// remove decimal places
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->dropColumn('decimal_places');
}
);
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->dropColumn('decimal_places');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function up(): void
{
// add decimal places to "transaction currencies".
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->smallInteger('decimal_places', false, true)->default(2);
}
);
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->smallInteger('decimal_places', false, true)->default(2);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// change field "startdate" to "start_date"
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->renameColumn('startdate', 'start_date');
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->renameColumn('startdate', 'start_date');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// add date field "end_date" after "start_date"
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->date('end_date')->nullable()->after('start_date');
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->date('end_date')->nullable()->after('start_date');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// drop "repeats" and "repeat_freq".
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('repeats');
}
);
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('repeat_freq');
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('repeats');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('repeat_freq');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -21,7 +21,9 @@
*/
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -36,60 +38,71 @@ class ChangesForV440 extends Migration
*/
public function down(): void
{
if (Schema::hasTable('currency_exchange_rates')) {
Schema::dropIfExists('currency_exchange_rates');
}
Schema::table(
'transactions',
static function (Blueprint $table) {
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');
Schema::dropIfExists('currency_exchange_rates');
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
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');
}
$table->dropColumn('transaction_currency_id');
}
}
);
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
if (!Schema::hasTable('currency_exchange_rates')) {
Schema::create(
'currency_exchange_rates',
static function (Blueprint $table) {
$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();
try {
Schema::create(
'currency_exchange_rates',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "notifications": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
Schema::table(
'transactions',
static function (Blueprint $table) {
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');
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -21,7 +21,9 @@
*/
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -37,53 +39,77 @@ class ChangesForV450 extends Migration
public function down(): void
{
// split up for sqlite compatibility
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->dropColumn('foreign_amount');
}
);
Schema::table(
'transactions',
static function (Blueprint $table) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('transactions_foreign_currency_id_foreign');
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->dropColumn('foreign_amount');
}
}
);
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->dropColumn('foreign_currency_id');
}
);
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('transactions_foreign_currency_id_foreign');
}
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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) {
$table->dropColumn('foreign_currency_id');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
// add "foreign_amount" to transactions
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->decimal('foreign_amount', 32, 12)->nullable()->after('amount');
}
);
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->decimal('foreign_amount', 32, 12)->nullable()->after('amount');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// add foreign transaction currency id to transactions (is nullable):
Schema::table(
'transactions',
static function (Blueprint $table) {
$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');
}
);
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -44,45 +45,54 @@ class ChangesForV470 extends Migration
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
if (!Schema::hasTable('link_types')) {
Schema::create(
'link_types',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->string('name');
$table->string('outward');
$table->string('inward');
$table->boolean('editable');
try {
Schema::create(
'link_types',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "link_types": %s', $e->getMessage()));
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')) {
Schema::create(
'journal_links',
static function (Blueprint $table) {
$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();
try {
Schema::create(
'journal_links',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "journal_links": %s', $e->getMessage()));
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

@ -21,7 +21,9 @@
*/
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -37,26 +39,35 @@ class ChangesForV470a extends Migration
*/
public function down(): void
{
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->dropColumn('reconciled');
}
);
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->dropColumn('reconciled');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
*
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->boolean('reconciled')->after('deleted_at')->default(0);
}
);
try {
Schema::table(
'transactions',
static function (Blueprint $table) {
$table->boolean('reconciled')->after('deleted_at')->default(0);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -43,20 +44,24 @@ class CreateOauthAuthCodesTable extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::create(
'oauth_auth_codes',
static function (Blueprint $table) {
$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();
}
);
try {
Schema::create(
'oauth_auth_codes',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "oauth_auth_codes": %s', $e->getMessage()));
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

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -43,22 +44,26 @@ class CreateOauthAccessTokensTable extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::create(
'oauth_access_tokens',
static function (Blueprint $table) {
$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();
}
);
try {
Schema::create(
'oauth_access_tokens',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "oauth_access_tokens": %s', $e->getMessage()));
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

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -43,18 +44,22 @@ class CreateOauthRefreshTokensTable extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::create(
'oauth_refresh_tokens',
static function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
}
);
try {
Schema::create(
'oauth_refresh_tokens',
static function (Blueprint $table) {
$table->string('id', 100)->primary();
$table->string('access_token_id', 100)->index();
$table->boolean('revoked');
$table->dateTime('expires_at')->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "oauth_refresh_tokens": %s', $e->getMessage()));
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

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -43,23 +44,27 @@ class CreateOauthClientsTable extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::create(
'oauth_clients',
static function (Blueprint $table) {
$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();
}
);
try {
Schema::create(
'oauth_clients',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "oauth_clients": %s', $e->getMessage()));
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

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -43,17 +44,21 @@ class CreateOauthPersonalAccessClientsTable extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*/
public function up(): void
{
Schema::create(
'oauth_personal_access_clients',
static function (Blueprint $table) {
$table->increments('id');
$table->integer('client_id')->index();
$table->timestamps();
}
);
try {
Schema::create(
'oauth_personal_access_clients',
static function (Blueprint $table) {
$table->increments('id');
$table->integer('client_id')->index();
$table->timestamps();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "oauth_personal_access_clients": %s', $e->getMessage()));
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

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -39,40 +41,60 @@ class ChangesForV472 extends Migration
*/
public function down(): void
{
Schema::table(
'attachments',
static function (Blueprint $table) {
$table->text('notes')->nullable();
}
);
Schema::table(
'budgets',
static function (Blueprint $table) {
$table->dropColumn('order');
}
);
try {
Schema::table(
'attachments',
static function (Blueprint $table) {
$table->text('notes')->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'budgets',
static function (Blueprint $table) {
$table->dropColumn('order');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
public function up(): void
{
Schema::table(
'attachments',
static function (Blueprint $table) {
$table->dropColumn('notes');
}
);
try {
Schema::table(
'attachments',
static function (Blueprint $table) {
$table->dropColumn('notes');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'budgets',
static function (Blueprint $table) {
$table->mediumInteger('order', false, true)->default(0);
}
);
try {
Schema::table(
'budgets',
static function (Blueprint $table) {
$table->mediumInteger('order', false, true)->default(0);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -40,45 +42,65 @@ class ChangesForV473 extends Migration
*/
public function down(): void
{
Schema::table(
'bills',
static function (Blueprint $table) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('bills_transaction_currency_id_foreign');
try {
Schema::table(
'bills',
static function (Blueprint $table) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('bills_transaction_currency_id_foreign');
}
$table->dropColumn('transaction_currency_id');
}
$table->dropColumn('transaction_currency_id');
}
);
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'rules',
static function (Blueprint $table) {
$table->dropColumn('strict');
}
);
try {
Schema::table(
'rules',
static function (Blueprint $table) {
$table->dropColumn('strict');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
public function up(): void
{
Schema::table(
'bills',
static function (Blueprint $table) {
$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(
'rules',
static function (Blueprint $table) {
$table->boolean('strict')->default(true);
}
);
try {
Schema::table(
'bills',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'rules',
static function (Blueprint $table) {
$table->boolean('strict')->default(true);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -23,7 +23,6 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
/**
* Class ChangesForV474.
@ -34,78 +33,19 @@ class ChangesForV474 extends Migration
{
/**
* Reverse the migrations.
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @return void
*/
public function down(): void
{
// split up for sqlite compatibility.
Schema::table(
'import_jobs',
static function (Blueprint $table) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('import_jobs_tag_id_foreign');
}
}
);
Schema::table(
'import_jobs',
static function (Blueprint $table) {
$table->dropColumn('provider');
}
);
Schema::table(
'import_jobs',
static function (Blueprint $table) {
$table->dropColumn('stage');
}
);
Schema::table(
'import_jobs',
static function (Blueprint $table) {
$table->dropColumn('transactions');
}
);
Schema::table(
'import_jobs',
static function (Blueprint $table) {
$table->dropColumn('errors');
}
);
Schema::table(
'import_jobs',
static function (Blueprint $table) {
$table->dropColumn('tag_id');
}
);
}
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
public function up(): void
{
Schema::table(
'import_jobs',
static function (Blueprint $table) {
$table->string('provider', 50)->after('file_type')->default('');
$table->string('stage', 50)->after('status')->default('');
$table->longText('transactions')->after('extended_status')->nullable();
$table->longText('errors')->after('transactions')->nullable();
$table->integer('tag_id', false, true)->nullable()->after('user_id');
$table->foreign('tag_id')->references('id')->on('tags')->onDelete('set null');
}
);
}
}

View File

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -48,106 +49,127 @@ class ChangesForV475 extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*
* @return void
*/
public function up(): void
{
Schema::create(
'recurrences',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->integer('transaction_type_id', false, true);
try {
Schema::create(
'recurrences',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "recurrences": %s', $e->getMessage()));
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::create(
'recurrences_transactions',
static function (Blueprint $table) {
$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) {
$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');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "recurrences_transactions": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
$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');
}
);
try {
Schema::create(
'recurrences_repetitions',
static function (Blueprint $table) {
$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) {
$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');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "recurrences_repetitions": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
}
);
try {
Schema::create(
'recurrences_meta',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('recurrence_id', false, true);
Schema::create(
'recurrences_meta',
static function (Blueprint $table) {
$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');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "recurrences_meta": %s', $e->getMessage()));
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::create(
'rt_meta',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('rt_id', false, true);
$table->foreign('recurrence_id')->references('id')->on('recurrences')->onDelete('cascade');
}
);
$table->string('name', 50);
$table->text('value');
Schema::create(
'rt_meta',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('rt_id', false, true);
$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) {
Log::error(sprintf('Could not create table "rt_meta": %s', $e->getMessage()));
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

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -39,33 +41,42 @@ class ChangesForV477 extends Migration
*/
public function down(): void
{
Schema::table(
'budget_limits',
static function (Blueprint $table) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('budget_limits_transaction_currency_id_foreign');
}
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('budget_limits_transaction_currency_id_foreign');
}
$table->dropColumn(['transaction_currency_id']);
}
);
$table->dropColumn(['transaction_currency_id']);
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
public function up(): void
{
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->integer('transaction_currency_id', false, true)->nullable()->after('budget_id');
$table->foreign('transaction_currency_id')->references('id')->on('transaction_currencies')->onDelete('set null');
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -37,29 +39,38 @@ class ChangesForV479 extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->dropColumn(['enabled']);
}
);
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->dropColumn(['enabled']);
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->boolean('enabled')->default(0)->after('deleted_at');
}
);
try {
Schema::table(
'transaction_currencies',
static function (Blueprint $table) {
$table->boolean('enabled')->default(0)->after('deleted_at');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -46,42 +47,51 @@ class ChangesForV4710 extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
public function up(): void
{
if (!Schema::hasTable('transaction_groups')) {
Schema::create(
'transaction_groups',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('user_id', false, true);
$table->string('title', 1024)->nullable();
try {
Schema::create(
'transaction_groups',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "transaction_groups": %s', $e->getMessage()));
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')) {
Schema::create(
'group_journals',
static function (Blueprint $table) {
$table->increments('id');
$table->integer('transaction_group_id', false, true);
$table->integer('transaction_journal_id', false, true);
try {
Schema::create(
'group_journals',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "group_journals": %s', $e->getMessage()));
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

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -45,7 +46,6 @@ class ChangesForV4711 extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
@ -59,18 +59,28 @@ class ChangesForV4711 extends Migration
* datetime (without a time zone) for all database engines because MySQL refuses to play
* nice.
*/
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
$table->dateTime('date')->change();
}
);
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
$table->dateTime('date')->change();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'preferences',
static function (Blueprint $table) {
$table->text('data')->nullable()->change();
}
);
try {
Schema::table(
'preferences',
static function (Blueprint $table) {
$table->text('data')->nullable()->change();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -44,7 +45,6 @@ class ChangesForV4712 extends Migration
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
@ -58,11 +58,16 @@ class ChangesForV4712 extends Migration
* datetime (without a time zone) for all database engines because MySQL refuses to play
* nice.
*/
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
$table->dateTime('date')->change();
}
);
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
$table->dateTime('date')->change();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -21,7 +21,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -39,17 +41,21 @@ class FixLdapConfiguration extends Migration
*/
public function down(): void
{
Schema::table(
'users',
static function (Blueprint $table) {
$table->dropColumn(['objectguid']);
}
);
try {
Schema::table(
'users',
static function (Blueprint $table) {
$table->dropColumn(['objectguid']);
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
@ -59,11 +65,16 @@ class FixLdapConfiguration extends Migration
* ADLdap2 appears to require the ability to store an objectguid for LDAP users
* now. To support this, we add the column.
*/
Schema::table(
'users',
static function (Blueprint $table) {
$table->uuid('objectguid')->nullable()->after('id');
}
);
try {
Schema::table(
'users',
static function (Blueprint $table) {
$table->uuid('objectguid')->nullable()->after('id');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -21,7 +21,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -38,64 +40,121 @@ class ChangesForV480 extends Migration
*/
public function down(): void
{
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
// drop transaction_group_id + foreign key.
// cannot drop foreign keys in SQLite:
if ('sqlite' !== config('database.default')) {
$table->dropForeign('transaction_journals_transaction_group_id_foreign');
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
// 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) {
Log::error(sprintf('Could not drop foreign ID: %s', $e->getMessage()));
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|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not drop column: %s', $e->getMessage()));
Log::error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
$table->dropColumn('transaction_group_id');
}
);
Schema::table(
'rule_groups',
static function (Blueprint $table) {
$table->dropColumn('stop_processing');
}
);
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'users',
static function (Blueprint $table) {
$table->dropColumn('mfa_secret');
}
);
try {
Schema::table(
'rule_groups',
static function (Blueprint $table) {
try {
$table->dropColumn('stop_processing');
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not drop column: %s', $e->getMessage()));
Log::error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'users',
static function (Blueprint $table) {
try {
$table->dropColumn('mfa_secret');
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not drop column: %s', $e->getMessage()));
Log::error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
* @SuppressWarnings(PHPMD.ShortMethodName)
*
* @return void
*/
public function up(): void
{
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
$table->integer('transaction_currency_id', false, true)->nullable()->change();
try {
Schema::table(
'transaction_journals',
static function (Blueprint $table) {
$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"
$table->foreign('transaction_group_id')->references('id')->on('transaction_groups')->onDelete('cascade');
}
);
Schema::table(
'rule_groups',
static function (Blueprint $table) {
$table->boolean('stop_processing')->default(false);
}
);
Schema::table(
'users',
static function (Blueprint $table) {
$table->string('mfa_secret', 50)->nullable();
}
);
// add foreign key for "transaction_group_id"
try {
$table->foreign('transaction_group_id')->references('id')->on('transaction_groups')->onDelete('cascade');
} catch (QueryException $e) {
Log::error(sprintf('Could not create foreign index: %s', $e->getMessage()));
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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'rule_groups',
static function (Blueprint $table) {
$table->boolean('stop_processing')->default(false);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'users',
static function (Blueprint $table) {
$table->string('mfa_secret', 50)->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -38,7 +39,7 @@ class MakeLocationsTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('locations');
}
@ -48,22 +49,27 @@ class MakeLocationsTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create(
'locations',
static function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
try {
Schema::create(
'locations',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "locations": %s', $e->getMessage()));
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

@ -22,6 +22,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -50,40 +51,27 @@ class ChangesForV520 extends Migration
public function up(): void
{
if (!Schema::hasTable('auto_budgets')) {
Schema::create(
'auto_budgets',
static function (Blueprint $table) {
$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);
try {
Schema::create(
'auto_budgets',
static function (Blueprint $table) {
$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');
}
);
}
if (!Schema::hasTable('telemetry')) {
Schema::create(
'telemetry',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->dateTime('submitted')->nullable();
$table->integer('user_id', false, true)->nullable();
$table->string('installation_id', 50);
$table->string('type', 25);
$table->string('key', 50);
$table->text('value');
$table->foreign('user_id')->references('id')->on('users')->onDelete('set null');
}
);
$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) {
Log::error(sprintf('Could not create table "auto_budgets": %s', $e->getMessage()));
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

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
/**
@ -51,28 +52,39 @@ class ChangesForV530 extends Migration
public function up(): void
{
if (!Schema::hasTable('object_groups')) {
Schema::create(
'object_groups',
static function (Blueprint $table) {
$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');
}
);
try {
Schema::create(
'object_groups',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "object_groups": %s', $e->getMessage()));
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')) {
Schema::create(
'object_groupables',
static function (Blueprint $table) {
$table->integer('object_group_id');
$table->integer('object_groupable_id', false, true);
$table->string('object_groupable_type', 255);
}
);
try {
Schema::create(
'object_groupables',
static function (Blueprint $table) {
$table->integer('object_group_id');
$table->integer('object_groupable_id', false, true);
$table->string('object_groupable_type', 255);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "object_groupables": %s', $e->getMessage()));
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

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -40,12 +42,17 @@ class ChangesForV530a extends Migration
*/
public function down(): void
{
Schema::table(
'bills',
static function (Blueprint $table) {
$table->dropColumn('order');
}
);
try {
Schema::table(
'bills',
static function (Blueprint $table) {
$table->dropColumn('order');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
@ -55,11 +62,16 @@ class ChangesForV530a extends Migration
*/
public function up(): void
{
Schema::table(
'bills',
static function (Blueprint $table) {
$table->integer('order', false, true)->default(0);
}
);
try {
Schema::table(
'bills',
static function (Blueprint $table) {
$table->integer('order', false, true)->default(0);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -40,27 +42,43 @@ class ChangesForV540 extends Migration
*/
public function down(): void
{
Schema::table(
'oauth_clients',
static function (Blueprint $table) {
$table->dropColumn('provider');
}
);
try {
Schema::table(
'oauth_clients',
static function (Blueprint $table) {
$table->dropColumn('provider');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'accounts',
static function (Blueprint $table) {
$table->dropColumn('order');
}
);
try {
Schema::table(
'accounts',
static function (Blueprint $table) {
$table->dropColumn('order');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'bills',
static function (Blueprint $table) {
$table->dropColumn('end_date');
$table->dropColumn('extension_date');
}
);
try {
Schema::table(
'bills',
static function (Blueprint $table) {
$table->dropColumn('end_date');
$table->dropColumn('extension_date');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
@ -70,31 +88,51 @@ class ChangesForV540 extends Migration
*/
public function up(): void
{
Schema::table(
'accounts',
static function (Blueprint $table) {
$table->integer('order', false, true)->default(0);
}
);
Schema::table(
'oauth_clients',
static function (Blueprint $table) {
$table->string('provider')->nullable();
}
);
Schema::table(
'bills',
static function (Blueprint $table) {
$table->date('end_date')->nullable()->after('date');
$table->date('extension_date')->nullable()->after('end_date');
}
);
try {
Schema::table(
'accounts',
static function (Blueprint $table) {
$table->integer('order', false, true)->default(0);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'oauth_clients',
static function (Blueprint $table) {
$table->string('provider')->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
'bills',
static function (Blueprint $table) {
$table->date('end_date')->nullable()->after('date');
$table->date('extension_date')->nullable()->after('end_date');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// make column nullable:
Schema::table(
'oauth_clients',
function (Blueprint $table) {
$table->string('secret', 100)->nullable()->change();
}
);
try {
Schema::table(
'oauth_clients',
function (Blueprint $table) {
$table->string('secret', 100)->nullable()->change();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -36,46 +38,62 @@ class ChangesForV550 extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
// recreate jobs table.
Schema::dropIfExists('jobs');
Schema::create(
'jobs',
static function (Blueprint $table) {
// 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']);
}
);
try {
Schema::create(
'jobs',
static function (Blueprint $table) {
// 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) {
Log::error(sprintf('Could not create table "jobs": %s', $e->getMessage()));
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.
Schema::table(
'budget_transaction_journal',
function (Blueprint $table) {
$table->dropForeign('budget_id_foreign');
$table->dropColumn('budget_limit_id');
}
);
try {
Schema::table(
'budget_transaction_journal',
function (Blueprint $table) {
$table->dropForeign('budget_id_foreign');
$table->dropColumn('budget_limit_id');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// drop failed jobs table.
Schema::dropIfExists('failed_jobs');
// drop fields from budget limits
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('period');
$table->dropColumn('generated');
}
);
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
$table->dropColumn('period');
$table->dropColumn('generated');
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::dropIfExists('webhook_attempts');
Schema::dropIfExists('webhook_messages');
Schema::dropIfExists('webhooks');
@ -86,123 +104,158 @@ class ChangesForV550 extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
// drop and recreate jobs table.
Schema::dropIfExists('jobs');
// this is the NEW table
Schema::create(
'jobs',
function (Blueprint $table) {
$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');
}
);
try {
Schema::create(
'jobs',
function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "jobs": %s', $e->getMessage()));
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.
Schema::dropIfExists('failed_jobs');
// create new failed_jobs table.
Schema::create(
'failed_jobs',
function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
}
);
try {
Schema::create(
'failed_jobs',
function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "failed_jobs": %s', $e->getMessage()));
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.
Schema::table(
'budget_transaction_journal',
function (Blueprint $table) {
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');
try {
Schema::table(
'budget_transaction_journal',
function (Blueprint $table) {
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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// append budget limits table.
// i swear I dropped & recreated this field 15 times already.
Schema::table(
'budget_limits',
static function (Blueprint $table) {
if (!Schema::hasColumn('budget_limits', 'period')) {
$table->string('period', 12)->nullable();
try {
Schema::table(
'budget_limits',
static function (Blueprint $table) {
if (!Schema::hasColumn('budget_limits', 'period')) {
$table->string('period', 12)->nullable();
}
if (!Schema::hasColumn('budget_limits', 'generated')) {
$table->boolean('generated')->default(false);
}
}
if (!Schema::hasColumn('budget_limits', 'generated')) {
$table->boolean('generated')->default(false);
}
}
);
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// new webhooks table
if (!Schema::hasTable('webhooks')) {
Schema::create(
'webhooks',
static function (Blueprint $table) {
$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', false);
$table->unsignedSmallInteger('response', false);
$table->unsignedSmallInteger('delivery', false);
$table->string('url', 1024);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->unique(['user_id', 'title']);
}
);
try {
Schema::create(
'webhooks',
static function (Blueprint $table) {
$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', false);
$table->unsignedSmallInteger('response', false);
$table->unsignedSmallInteger('delivery', false);
$table->string('url', 1024);
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->unique(['user_id', 'title']);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "webhooks": %s', $e->getMessage()));
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')) {
Schema::create(
'webhook_messages',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->boolean('sent')->default(false);
$table->boolean('errored')->default(false);
try {
Schema::create(
'webhook_messages',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "webhook_messages": %s', $e->getMessage()));
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')) {
Schema::create(
'webhook_attempts',
static function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->softDeletes();
$table->integer('webhook_message_id', false, true);
$table->unsignedSmallInteger('status_code')->default(0);
try {
Schema::create(
'webhook_attempts',
static function (Blueprint $table) {
$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) {
Log::error(sprintf('Could not create table "webhook_attempts": %s', $e->getMessage()));
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

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -38,15 +40,20 @@ class ChangesForV550b2 extends Migration
*/
public function down(): void
{
Schema::table(
'recurrences_transactions',
function (Blueprint $table) {
$table->dropForeign('type_foreign');
if (Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
$table->dropColumn('transaction_type_id');
try {
Schema::table(
'recurrences_transactions',
function (Blueprint $table) {
$table->dropForeign('type_foreign');
if (Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
$table->dropColumn('transaction_type_id');
}
}
}
);
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
@ -57,14 +64,19 @@ class ChangesForV550b2 extends Migration
public function up(): void
{
// expand recurrence transaction table
Schema::table(
'recurrences_transactions',
function (Blueprint $table) {
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');
try {
Schema::table(
'recurrences_transactions',
function (Blueprint $table) {
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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -31,26 +33,36 @@ class AddLdapColumnsToUsersTable extends Migration
/**
* Reverse the migrations.
*/
public function down()
public function down(): void
{
Schema::table(
'users',
function (Blueprint $table) {
$table->dropColumn(['domain']);
}
);
try {
Schema::table(
'users',
function (Blueprint $table) {
$table->dropColumn(['domain']);
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Run the migrations.
*/
public function up()
public function up(): void
{
Schema::table(
'users',
function (Blueprint $table) {
$table->string('domain')->nullable();
}
);
try {
Schema::table(
'users',
function (Blueprint $table) {
$table->string('domain')->nullable();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -36,7 +37,7 @@ class ExtendCurrencyInfo extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
//
}
@ -46,14 +47,19 @@ class ExtendCurrencyInfo extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::table(
'transaction_currencies',
function (Blueprint $table) {
$table->string('code', 51)->change();
$table->string('symbol', 51)->change();
}
);
try {
Schema::table(
'transaction_currencies',
function (Blueprint $table) {
$table->string('code', 51)->change();
$table->string('symbol', 51)->change();
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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,7 @@ class DropTeleTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('telemetry');
}
@ -45,7 +45,7 @@ class DropTeleTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
Schema::dropIfExists('telemetry');
}

View File

@ -22,7 +22,9 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -53,32 +55,42 @@ class UserGroups extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
// remove columns from tables
/** @var string $tableName */
foreach ($this->tables as $tableName) {
try {
Schema::table(
$tableName,
function (Blueprint $table) use ($tableName) {
$table->dropForeign(sprintf('%s_to_ugi', $tableName));
if (Schema::hasColumn($tableName, 'user_group_id')) {
$table->dropColumn('user_group_id');
}
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
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(
$tableName,
function (Blueprint $table) use ($tableName) {
$table->dropForeign(sprintf('%s_to_ugi', $tableName));
if (Schema::hasColumn($tableName, 'user_group_id')) {
'users',
function (Blueprint $table) {
$table->dropForeign('type_user_group_id');
if (Schema::hasColumn('users', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
}
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
Schema::table(
'users',
function (Blueprint $table) {
$table->dropForeign('type_user_group_id');
if (Schema::hasColumn('users', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
}
);
Schema::dropIfExists('group_memberships');
Schema::dropIfExists('user_roles');
Schema::dropIfExists('user_groups');
@ -89,76 +101,100 @@ class UserGroups extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
/*
* user is a member of a user_group through a user_group_role
* may have multiple roles in a group
*/
Schema::create(
'user_groups',
static function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
try {
Schema::create(
'user_groups',
static function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->string('title', 255);
$table->unique('title');
}
);
Schema::create(
'user_roles',
static function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->string('title', 255);
$table->unique('title');
}
);
Schema::create(
'group_memberships',
static function (Blueprint $table) {
$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']);
}
);
Schema::table(
'users',
function (Blueprint $table) {
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');
$table->string('title', 255);
$table->unique('title');
}
}
);
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "user_groups": %s', $e->getMessage()));
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::create(
'user_roles',
static function (Blueprint $table) {
$table->bigIncrements('id');
$table->timestamps();
$table->softDeletes();
$table->string('title', 255);
$table->unique('title');
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "user_roles": %s', $e->getMessage()));
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::create(
'group_memberships',
static function (Blueprint $table) {
$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']);
}
);
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "group_memberships": %s', $e->getMessage()));
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',
function (Blueprint $table) {
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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// ADD columns from tables
/** @var string $tableName */
foreach ($this->tables as $tableName) {
Schema::table(
$tableName,
function (Blueprint $table) use ($tableName) {
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'
);
try {
Schema::table(
$tableName,
function (Blueprint $table) use ($tableName) {
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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
}

View File

@ -23,6 +23,7 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
@ -36,7 +37,7 @@ class CreateLocalPersonalAccessTokensTable extends Migration
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('personal_access_tokens');
}
@ -46,18 +47,23 @@ class CreateLocalPersonalAccessTokensTable extends Migration
*
* @return void
*/
public function up()
public function up(): void
{
if (!Schema::hasTable('personal_access_tokens')) {
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
try {
Schema::create('personal_access_tokens', function (Blueprint $table) {
$table->bigIncrements('id');
$table->morphs('tokenable');
$table->string('name');
$table->string('token', 64)->unique();
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
});
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "personal_access_tokens": %s', $e->getMessage()));
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

@ -22,8 +22,11 @@
declare(strict_types=1);
use Doctrine\DBAL\Schema\Exception\ColumnDoesNotExist;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
/**
@ -37,15 +40,20 @@ return new class () extends Migration {
*/
public function up(): void
{
Schema::table(
'currency_exchange_rates',
function (Blueprint $table) {
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');
try {
Schema::table(
'currency_exchange_rates',
function (Blueprint $table) {
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) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
@ -55,14 +63,19 @@ return new class () extends Migration {
*/
public function down(): void
{
Schema::table(
'currency_exchange_rates',
function (Blueprint $table) {
$table->dropForeign('cer_to_ugi');
if (Schema::hasColumn('currency_exchange_rates', 'user_group_id')) {
$table->dropColumn('user_group_id');
try {
Schema::table(
'currency_exchange_rates',
function (Blueprint $table) {
$table->dropForeign('cer_to_ugi');
if (Schema::hasColumn('currency_exchange_rates', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
}
}
);
);
} catch (QueryException|ColumnDoesNotExist $e) {
Log::error(sprintf('Could not execute query: %s', $e->getMessage()));
Log::error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
};

View File

@ -23,7 +23,9 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
@ -32,16 +34,21 @@ return new class () extends Migration {
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
try {
Schema::create('notifications', function (Blueprint $table) {
$table->uuid('id')->primary();
$table->string('type');
$table->morphs('notifiable');
$table->text('data');
$table->timestamp('read_at')->nullable();
$table->timestamps();
});
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "notifications": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
/**
@ -49,7 +56,7 @@ return new class () extends Migration {
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('notifications');
}

View File

@ -23,7 +23,9 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
@ -34,16 +36,21 @@ return new class () extends Migration {
*/
public function up(): void
{
Schema::create('invited_users', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->integer('user_id', false, true);
$table->string('email', 255);
$table->string('invite_code', 64);
$table->dateTime('expires');
$table->boolean('redeemed');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
try {
Schema::create('invited_users', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->integer('user_id', false, true);
$table->string('email', 255);
$table->string('invite_code', 64);
$table->dateTime('expires');
$table->boolean('redeemed');
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
});
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "invited_users": %s', $e->getMessage()));
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

@ -23,7 +23,9 @@
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\QueryException;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Schema;
return new class () extends Migration {
@ -32,23 +34,28 @@ return new class () extends Migration {
*
* @return void
*/
public function up()
public function up(): void
{
Schema::create('audit_log_entries', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->softDeletes();
try {
Schema::create('audit_log_entries', function (Blueprint $table) {
$table->id();
$table->timestamps();
$table->softDeletes();
$table->integer('auditable_id', false, true);
$table->string('auditable_type');
$table->integer('auditable_id', false, true);
$table->string('auditable_type');
$table->integer('changer_id', false, true);
$table->string('changer_type');
$table->integer('changer_id', false, true);
$table->string('changer_type');
$table->string('action', 255);
$table->text('before')->nullable();
$table->text('after')->nullable();
});
$table->string('action', 255);
$table->text('before')->nullable();
$table->text('after')->nullable();
});
} catch (QueryException $e) {
Log::error(sprintf('Could not create table "audit_log_entries": %s', $e->getMessage()));
Log::error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
/**
@ -56,7 +63,7 @@ return new class () extends Migration {
*
* @return void
*/
public function down()
public function down(): void
{
Schema::dropIfExists('audit_log_entries');
}

View File

@ -33,8 +33,6 @@ use PDOException;
class TransactionCurrencySeeder extends Seeder
{
/**
* @SuppressWarnings(PHPMD.ShortMethodName)
* @SuppressWarnings(PHPMD.ExcessiveMethodLength)
*/
public function run()
{

View File

@ -11,14 +11,14 @@
},
"dependencies": {
"@popperjs/core": "^2.11.2",
"@quasar/extras": "^1.16.1",
"@quasar/extras": "^1.16.2",
"apexcharts": "^3.32.1",
"axios": "^0.21.1",
"axios-cache-adapter": "^2.7.3",
"core-js": "^3.6.5",
"date-fns": "^2.28.0",
"pinia": "^2.0.14",
"quasar": "^2.11.9",
"quasar": "^2.11.10",
"vue": "3",
"vue-i18n": "^9.0.0",
"vue-router": "^4.0.0",

View File

@ -338,7 +338,7 @@ page container: q-ma-xs (margin all, xs) AND q-mb-md to give the page content so
<q-footer class="bg-grey-8 text-white" bordered>
<q-toolbar>
<div>
<small>Firefly III v v6.0.6 &copy; James Cole, AGPL-3.0-or-later.</small>
<small>Firefly III v v6.0.7 &copy; James Cole, AGPL-3.0-or-later.</small>
</div>
</q-toolbar>
</q-footer>

View File

@ -1437,10 +1437,10 @@
core-js "^3.6.5"
core-js-compat "^3.6.5"
"@quasar/extras@^1.16.1":
version "1.16.1"
resolved "https://registry.yarnpkg.com/@quasar/extras/-/extras-1.16.1.tgz#1be607c200c8426497b7a6de21056edb28ef122a"
integrity sha512-bRnWSC469Qogw0ceDVd0yTQVBQjyhV6L10EMixXK1dpOs9tWGKRVgyyGZ5DEBkDgyn4BeRuV5s5e9VrQdQPsOg==
"@quasar/extras@^1.16.2":
version "1.16.2"
resolved "https://registry.yarnpkg.com/@quasar/extras/-/extras-1.16.2.tgz#fcc6374a882253051f9d7302cb9ba828f0010cdf"
integrity sha512-spDc1DrwxGts0MjmOAJ11xpxJANhCI1vEadxaw89wRQJ/QfKd0HZrwN7uN1U15cRozGRkJpdbsnP4cVXpkPysA==
"@quasar/fastclick@1.1.5":
version "1.1.5"
@ -5396,10 +5396,10 @@ qs@6.9.7:
resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.7.tgz#4610846871485e1e048f44ae3b94033f0e675afe"
integrity sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==
quasar@^2.11.9:
version "2.11.9"
resolved "https://registry.yarnpkg.com/quasar/-/quasar-2.11.9.tgz#239413cd14e9be9bcabc125f97209944832e5277"
integrity sha512-ZHSZRQJk/zN6whhvihh0EyRpAs3IYBZZ+1O5/RSe7nXyOXOVi6RwPBzleab5HoTxtHL5Yuk3/bKgb3CywAyBQQ==
quasar@^2.11.10:
version "2.11.10"
resolved "https://registry.yarnpkg.com/quasar/-/quasar-2.11.10.tgz#31bf49dd7995673b2116aa250bb0b019ddcae74f"
integrity sha512-pV7bMdY/FUmOvNhZ2XjKSXJH92fsDu0cU/z7a9roPKV54cW41N1en3sLATrirjPComyZnk4uXrMdGtXp8+IpCg==
queue-microtask@^1.2.2:
version "1.2.3"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,9 @@
background-color: #55606a;
border-color: #454e56;
}
.skin-firefly-iii .alert-success > a {
color: #fff;
}
.skin-firefly-iii .text-muted {
color: #b0b8c0;
}

File diff suppressed because one or more lines are too long

View File

@ -7,13 +7,13 @@
color: #999;
}
.skin-firefly-iii .money-positive {
color: #00a65a;
color: #3c763d;
}
.skin-firefly-iii .money-negative {
color: #dd4b39;
color: #a94442;
}
.skin-firefly-iii .money-transfer {
color: #0073b7;
color: #31708f;
}
.skin-firefly-iii .main-header .navbar {
background-color: #3c8dbc;

View File

@ -1 +1 @@
.skin-firefly-iii .money-neutral{color:#999}.skin-firefly-iii .money-positive{color:#00a65a}.skin-firefly-iii .money-negative{color:#dd4b39}.skin-firefly-iii .money-transfer{color:#0073b7}.skin-firefly-iii .main-header .navbar{background-color:#3c8dbc}.skin-firefly-iii .main-header .navbar .nav>li>a{color:#fff}.skin-firefly-iii .main-header .navbar .nav>li>a:hover,.skin-firefly-iii .main-header .navbar .nav>li>a:active,.skin-firefly-iii .main-header .navbar .nav>li>a:focus,.skin-firefly-iii .main-header .navbar .nav .open>a,.skin-firefly-iii .main-header .navbar .nav .open>a:hover,.skin-firefly-iii .main-header .navbar .nav .open>a:focus,.skin-firefly-iii .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-firefly-iii .main-header .navbar .sidebar-toggle{color:#fff}.skin-firefly-iii .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-firefly-iii .main-header .navbar .sidebar-toggle{color:#fff}.skin-firefly-iii .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-firefly-iii .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-firefly-iii .main-header .navbar .dropdown-menu li a{color:#fff}.skin-firefly-iii .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-firefly-iii .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-firefly-iii .main-header .logo:hover{background-color:#3b8ab8}.skin-firefly-iii .main-header li.user-header{background-color:#3c8dbc}.skin-firefly-iii .content-header{background:transparent}.skin-firefly-iii .wrapper,.skin-firefly-iii .main-sidebar,.skin-firefly-iii .left-side{background-color:#f9fafc}.skin-firefly-iii .main-sidebar{border-right:1px solid #d2d6de}.skin-firefly-iii .user-panel>.info,.skin-firefly-iii .user-panel>.info>a{color:#444}.skin-firefly-iii .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-firefly-iii .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-firefly-iii .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-firefly-iii .sidebar-menu>li:hover>a,.skin-firefly-iii .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-firefly-iii .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-firefly-iii .sidebar-menu>li.active>a{font-weight:600}.skin-firefly-iii .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-firefly-iii .sidebar a{color:#444}.skin-firefly-iii .sidebar a:hover{text-decoration:none}.skin-firefly-iii .sidebar-menu .treeview-menu>li>a{color:#777}.skin-firefly-iii .sidebar-menu .treeview-menu>li.active>a,.skin-firefly-iii .sidebar-menu .treeview-menu>li>a:hover{color:#000}.skin-firefly-iii .sidebar-menu .treeview-menu>li.active>a{font-weight:600}.skin-firefly-iii .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-firefly-iii .sidebar-form input[type="text"],.skin-firefly-iii .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-firefly-iii .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-firefly-iii .sidebar-form input[type="text"]:focus,.skin-firefly-iii .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-firefly-iii .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-firefly-iii .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-firefly-iii.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-firefly-iii .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}
.skin-firefly-iii .money-neutral{color:#999}.skin-firefly-iii .money-positive{color:#3c763d}.skin-firefly-iii .money-negative{color:#a94442}.skin-firefly-iii .money-transfer{color:#31708f}.skin-firefly-iii .main-header .navbar{background-color:#3c8dbc}.skin-firefly-iii .main-header .navbar .nav>li>a{color:#fff}.skin-firefly-iii .main-header .navbar .nav>li>a:hover,.skin-firefly-iii .main-header .navbar .nav>li>a:active,.skin-firefly-iii .main-header .navbar .nav>li>a:focus,.skin-firefly-iii .main-header .navbar .nav .open>a,.skin-firefly-iii .main-header .navbar .nav .open>a:hover,.skin-firefly-iii .main-header .navbar .nav .open>a:focus,.skin-firefly-iii .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-firefly-iii .main-header .navbar .sidebar-toggle{color:#fff}.skin-firefly-iii .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-firefly-iii .main-header .navbar .sidebar-toggle{color:#fff}.skin-firefly-iii .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-firefly-iii .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-firefly-iii .main-header .navbar .dropdown-menu li a{color:#fff}.skin-firefly-iii .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-firefly-iii .main-header .logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-firefly-iii .main-header .logo:hover{background-color:#3b8ab8}.skin-firefly-iii .main-header li.user-header{background-color:#3c8dbc}.skin-firefly-iii .content-header{background:transparent}.skin-firefly-iii .wrapper,.skin-firefly-iii .main-sidebar,.skin-firefly-iii .left-side{background-color:#f9fafc}.skin-firefly-iii .main-sidebar{border-right:1px solid #d2d6de}.skin-firefly-iii .user-panel>.info,.skin-firefly-iii .user-panel>.info>a{color:#444}.skin-firefly-iii .sidebar-menu>li{-webkit-transition:border-left-color .3s ease;-o-transition:border-left-color .3s ease;transition:border-left-color .3s ease}.skin-firefly-iii .sidebar-menu>li.header{color:#848484;background:#f9fafc}.skin-firefly-iii .sidebar-menu>li>a{border-left:3px solid transparent;font-weight:600}.skin-firefly-iii .sidebar-menu>li:hover>a,.skin-firefly-iii .sidebar-menu>li.active>a{color:#000;background:#f4f4f5}.skin-firefly-iii .sidebar-menu>li.active{border-left-color:#3c8dbc}.skin-firefly-iii .sidebar-menu>li.active>a{font-weight:600}.skin-firefly-iii .sidebar-menu>li>.treeview-menu{background:#f4f4f5}.skin-firefly-iii .sidebar a{color:#444}.skin-firefly-iii .sidebar a:hover{text-decoration:none}.skin-firefly-iii .sidebar-menu .treeview-menu>li>a{color:#777}.skin-firefly-iii .sidebar-menu .treeview-menu>li.active>a,.skin-firefly-iii .sidebar-menu .treeview-menu>li>a:hover{color:#000}.skin-firefly-iii .sidebar-menu .treeview-menu>li.active>a{font-weight:600}.skin-firefly-iii .sidebar-form{border-radius:3px;border:1px solid #d2d6de;margin:10px 10px}.skin-firefly-iii .sidebar-form input[type="text"],.skin-firefly-iii .sidebar-form .btn{box-shadow:none;background-color:#fff;border:1px solid transparent;height:35px}.skin-firefly-iii .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-firefly-iii .sidebar-form input[type="text"]:focus,.skin-firefly-iii .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-firefly-iii .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-firefly-iii .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}@media (min-width:768px){.skin-firefly-iii.sidebar-mini.sidebar-collapse .sidebar-menu>li>.treeview-menu{border-left:1px solid #d2d6de}}.skin-firefly-iii .main-footer{border-top-color:#d2d6de}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8}

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1 @@
<!DOCTYPE html><html><head><base href=/v3/ ><title>Firefly III</title><meta charset=utf-8><meta content="Personal finances manager" name=description><meta content="telephone=no" name=format-detection><meta content=no name=msapplication-tap-highlight><meta content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width" name=viewport><link href=favicon-32x32.png rel=icon sizes=32x32 type=image/png><link href=favicon-16x16.png rel=icon sizes=16x16 type=image/png><link href=maskable76.png rel=apple-touch-icon sizes=76x76><link href=maskable120.png rel=apple-touch-icon sizes=120x120><link href=maskable152.png rel=apple-touch-icon sizes=152x152><link href=apple-touch-icon.png rel=apple-touch-icon sizes=180x180><link color=#3c8dbc href=safari-pinned-tab.svg rel=mask-icon><link href=maskable192.png rel=icon sizes=192x192><link href=maskable128.png rel=icon sizes=128x128><link href=manifest.webmanifest rel=manifest><meta content=#1e6581 name=msapplication-TileColor><meta content=maskable512.png name=msapplication-TileImage><meta content=no name=msapplication-tap-highlight><meta content="Firefly III" name=application-name><meta content="noindex, nofollow, noarchive, noodp, NoImageIndex, noydir" name=robots><meta content=yes name=apple-mobile-web-app-capable><meta content="Firefly III" name=apple-mobile-web-app-title><meta content="Firefly III" name=application-name><meta content=#3c8dbc name=msapplication-TileColor><meta content="mstile-144x144.png?v=3e8AboOwbd" name=msapplication-TileImage><meta content=#3c8dbc name=theme-color><script defer src=/v3/js/vendor.95aafae2.js></script><script defer src=/v3/js/app.6c5caed8.js></script><link href=/v3/css/vendor.f166e113.css rel=stylesheet><link href=/v3/css/app.50c7ba73.css rel=stylesheet></head><body><div id=q-app></div></body></html>
<!DOCTYPE html><html><head><base href=/v3/ ><title>Firefly III</title><meta charset=utf-8><meta content="Personal finances manager" name=description><meta content="telephone=no" name=format-detection><meta content=no name=msapplication-tap-highlight><meta content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width" name=viewport><link href=favicon-32x32.png rel=icon sizes=32x32 type=image/png><link href=favicon-16x16.png rel=icon sizes=16x16 type=image/png><link href=maskable76.png rel=apple-touch-icon sizes=76x76><link href=maskable120.png rel=apple-touch-icon sizes=120x120><link href=maskable152.png rel=apple-touch-icon sizes=152x152><link href=apple-touch-icon.png rel=apple-touch-icon sizes=180x180><link color=#3c8dbc href=safari-pinned-tab.svg rel=mask-icon><link href=maskable192.png rel=icon sizes=192x192><link href=maskable128.png rel=icon sizes=128x128><link href=manifest.webmanifest rel=manifest><meta content=#1e6581 name=msapplication-TileColor><meta content=maskable512.png name=msapplication-TileImage><meta content=no name=msapplication-tap-highlight><meta content="Firefly III" name=application-name><meta content="noindex, nofollow, noarchive, noodp, NoImageIndex, noydir" name=robots><meta content=yes name=apple-mobile-web-app-capable><meta content="Firefly III" name=apple-mobile-web-app-title><meta content="Firefly III" name=application-name><meta content=#3c8dbc name=msapplication-TileColor><meta content="mstile-144x144.png?v=3e8AboOwbd" name=msapplication-TileImage><meta content=#3c8dbc name=theme-color><script defer src=/v3/js/vendor.77517468.js></script><script defer src=/v3/js/app.84f54798.js></script><link href=/v3/css/vendor.ab47bc61.css rel=stylesheet><link href=/v3/css/app.50c7ba73.css rel=stylesheet></head><body><div id=q-app></div></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1302,7 +1302,12 @@ return [
// preferences
'dark_mode_option_browser' => 'Let your browser decide',
'dark_mode_option_light' => 'Always light',
'dark_mode_option_dark' => 'Always dark',
'equal_to_language' => '(равно на език)',
'dark_mode_preference' => 'Dark mode',
'dark_mode_preference_help' => 'Tell Firefly III when to use dark mode.',
'pref_home_screen_accounts' => 'Сметки на началния екран',
'pref_home_screen_accounts_help' => 'Кои сметки трябва да се виждат на началната страница?',
'pref_view_range' => 'Виж диапазон',

Some files were not shown because too many files have changed in this diff Show More