Clean up migrations

This commit is contained in:
James Cole 2023-08-11 19:37:52 +02:00
parent a9bd0f551d
commit db94f18d46
No known key found for this signature in database
GPG Key ID: B49A324B7EAD6D80
47 changed files with 383 additions and 338 deletions

View File

@ -89,8 +89,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'account_types', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'account_types', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -117,8 +117,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'transaction_currencies', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'transaction_currencies', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -143,8 +143,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'transaction_types', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'transaction_types', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -172,8 +172,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'jobs', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'jobs', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -195,8 +195,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'password_resets', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'password_resets', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -219,8 +219,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'permissions', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'permissions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -243,8 +243,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'roles', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'roles', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -269,8 +269,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'permission_role', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'permission_role', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -294,8 +294,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'sessions', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'sessions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -318,8 +318,8 @@ class CreateSupportTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'configuration', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'configuration', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}

View File

@ -65,8 +65,8 @@ class CreateUsersTable extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'users', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'users', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}

View File

@ -111,8 +111,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'accounts', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'accounts', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -130,8 +130,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'account_meta', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'account_meta', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -158,8 +158,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'piggy_banks', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'piggy_banks', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -178,8 +178,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'piggy_bank_repetitions', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'piggy_bank_repetitions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -211,8 +211,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'attachments', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'attachments', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -245,8 +245,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'bills', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'bills', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -271,8 +271,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'budgets', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'budgets', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
if (!Schema::hasTable('budget_limits')) {
@ -291,8 +291,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'budget_limits', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'budget_limits', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
if (!Schema::hasTable('limit_repetitions')) {
@ -310,8 +310,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'limit_repetitions', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'limit_repetitions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -338,8 +338,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'categories', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'categories', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -361,8 +361,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'preferences', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'preferences', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -387,8 +387,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'role_user', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'role_user', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -414,8 +414,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'rule_groups', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'rule_groups', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
if (!Schema::hasTable('rules')) {
@ -442,8 +442,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'rules', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'rules', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
if (!Schema::hasTable('rule_actions')) {
@ -467,8 +467,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'rule_actions', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'rule_actions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
if (!Schema::hasTable('rule_triggers')) {
@ -492,8 +492,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'rule_triggers', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'rule_triggers', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -526,8 +526,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'tags', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'tags', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}
@ -565,8 +565,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'transaction_journals', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'transaction_journals', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -585,8 +585,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'journal_meta', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'journal_meta', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -606,8 +606,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'tag_transaction_journal', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'tag_transaction_journal', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -624,8 +624,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'budget_transaction_journal', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'budget_transaction_journal', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -642,8 +642,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'category_transaction_journal', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'category_transaction_journal', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -664,8 +664,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'piggy_bank_events', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'piggy_bank_events', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -687,8 +687,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'transactions', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'transactions', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -706,8 +706,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'budget_transaction', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'budget_transaction', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
@ -725,8 +725,8 @@ class CreateMainTables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_ERROR, 'category_transaction', $e->getMessage()));
Log::error(self::TABLE_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_ERROR, 'category_transaction', $e->getMessage()));
app('log')->error(self::TABLE_ALREADY_EXISTS);
}
}
}

View File

@ -33,15 +33,11 @@ class ChangesFor3101 extends Migration
/**
* Reverse the migrations.
*/
public function down(): void
{
}
public function down(): void {}
/**
* Run the migrations.
*
*/
public function up(): void
{
}
public function up(): void {}
}

View File

@ -38,9 +38,7 @@ class FixNullables extends Migration
/**
* Reverse the migrations.
*/
public function down(): void
{
}
public function down(): void {}
/**
* Run the migrations.
@ -57,8 +55,8 @@ class FixNullables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_UPDATE_ERROR, 'rule_groups', $e->getMessage()));
Log::error(self::COLUMN_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_UPDATE_ERROR, 'rule_groups', $e->getMessage()));
app('log')->error(self::COLUMN_ALREADY_EXISTS);
}
}
@ -71,8 +69,8 @@ class FixNullables extends Migration
}
);
} catch (QueryException $e) {
Log::error(sprintf(self::TABLE_UPDATE_ERROR, 'rules', $e->getMessage()));
Log::error(self::COLUMN_ALREADY_EXISTS);
app('log')->error(sprintf(self::TABLE_UPDATE_ERROR, 'rules', $e->getMessage()));
app('log')->error(self::COLUMN_ALREADY_EXISTS);
}
}
}

View File

@ -47,8 +47,8 @@ class ExpandTransactionsTable extends Migration
}
);
} catch (QueryException | ColumnDoesNotExist $e) {
Log::error(sprintf('Could not drop column "identifier": %s', $e->getMessage()));
Log::error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
app('log')->error(sprintf('Could not drop column "identifier": %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -68,8 +68,8 @@ class ExpandTransactionsTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -61,8 +61,8 @@ class ChangesForV410 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "notes": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -46,8 +46,8 @@ class ChangesForV420 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -67,8 +67,8 @@ class ChangesForV420 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -65,8 +65,8 @@ class ChangesForV430 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "available_budgets": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -48,8 +48,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
if (!Schema::hasColumn('budget_limits', 'repeats')) {
@ -61,8 +61,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
// change field "start_date" to "startdate"
@ -75,8 +75,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -90,8 +90,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
// remove decimal places
@ -104,8 +104,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -126,8 +126,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -141,8 +141,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -156,8 +156,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -171,8 +171,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
if (Schema::hasColumn('budget_limits', 'repeat_freq')) {
@ -184,8 +184,8 @@ class ChangesForV431 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -53,8 +53,8 @@ class ChangesForV440 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -85,8 +85,8 @@ class ChangesForV440 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "notifications": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
if (!Schema::hasColumn('transactions', 'transaction_currency_id')) {
@ -101,8 +101,8 @@ class ChangesForV440 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -48,8 +48,8 @@ class ChangesForV450 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -64,8 +64,8 @@ class ChangesForV450 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
if (Schema::hasColumn('transactions', 'foreign_currency_id')) {
try {
@ -76,8 +76,8 @@ class ChangesForV450 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -98,8 +98,8 @@ class ChangesForV450 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -114,8 +114,8 @@ class ChangesForV450 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -65,8 +65,8 @@ class ChangesForV470 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "link_types": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -90,8 +90,8 @@ class ChangesForV470 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "journal_links": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -48,8 +48,8 @@ class ChangesForV470a extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -69,8 +69,8 @@ class ChangesForV470a extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -61,8 +61,8 @@ class CreateOauthAuthCodesTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "oauth_auth_codes": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -63,8 +63,8 @@ class CreateOauthAccessTokensTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "oauth_access_tokens": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -59,8 +59,8 @@ class CreateOauthRefreshTokensTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "oauth_refresh_tokens": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -64,8 +64,8 @@ class CreateOauthClientsTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "oauth_clients": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -58,8 +58,8 @@ class CreateOauthPersonalAccessClientsTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "oauth_personal_access_clients": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -50,8 +50,8 @@ class ChangesForV472 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -64,8 +64,8 @@ class ChangesForV472 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -86,8 +86,8 @@ class ChangesForV472 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -100,8 +100,8 @@ class ChangesForV472 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -55,8 +55,8 @@ class ChangesForV473 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -69,8 +69,8 @@ class ChangesForV473 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -92,8 +92,8 @@ class ChangesForV473 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
if (!Schema::hasColumn('rules', 'strict')) {
@ -105,8 +105,8 @@ class ChangesForV473 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -36,16 +36,12 @@ class ChangesForV474 extends Migration
*
* @return void
*/
public function down(): void
{
}
public function down(): void {}
/**
* Run the migrations.
*
* @return void
*/
public function up(): void
{
}
public function up(): void {}
}

View File

@ -81,8 +81,8 @@ class ChangesForV475 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "recurrences": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
if (!Schema::hasTable('recurrences_transactions')) {
@ -111,8 +111,8 @@ class ChangesForV475 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "recurrences_transactions": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -134,8 +134,8 @@ class ChangesForV475 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "recurrences_repetitions": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -156,8 +156,8 @@ class ChangesForV475 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "recurrences_meta": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -178,8 +178,8 @@ class ChangesForV475 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "rt_meta": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -55,8 +55,8 @@ class ChangesForV477 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -78,8 +78,8 @@ class ChangesForV477 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -50,8 +50,8 @@ class ChangesForV479 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -72,8 +72,8 @@ class ChangesForV479 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -67,8 +67,8 @@ class ChangesForV4710 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "transaction_groups": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -89,8 +89,8 @@ class ChangesForV4710 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "group_journals": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -67,8 +67,8 @@ class ChangesForV4711 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
try {
@ -79,8 +79,8 @@ class ChangesForV4711 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -66,8 +66,8 @@ class ChangesForV4712 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -50,8 +50,8 @@ class FixLdapConfiguration extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -76,8 +76,8 @@ class FixLdapConfiguration extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -52,21 +52,21 @@ class ChangesForV480 extends Migration
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.');
app('log')->error(sprintf('Could not drop foreign ID: %s', $e->getMessage()));
app('log')->error('If the foreign ID does not exist (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
try {
$table->dropColumn('transaction_group_id');
} catch (QueryException | 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.');
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
);
} catch (QueryException $e) {
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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -79,14 +79,14 @@ class ChangesForV480 extends Migration
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.');
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
);
} catch (QueryException $e) {
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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -99,14 +99,14 @@ class ChangesForV480 extends Migration
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.');
app('log')->error(sprintf('Could not drop column: %s', $e->getMessage()));
app('log')->error('If the column does not exist, this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
);
} catch (QueryException $e) {
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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -134,16 +134,16 @@ class ChangesForV480 extends Migration
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(
app('log')->error(sprintf('Could not create foreign index: %s', $e->getMessage()));
app('log')->error(
'If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.'
);
}
}
);
} catch (QueryException $e) {
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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -157,8 +157,8 @@ class ChangesForV480 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -172,8 +172,8 @@ class ChangesForV480 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -69,8 +69,8 @@ class MakeLocationsTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "locations": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -69,8 +69,8 @@ class ChangesForV520 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "auto_budgets": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -66,8 +66,8 @@ class ChangesForV530 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "object_groups": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -82,8 +82,8 @@ class ChangesForV530 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "object_groupables": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -51,8 +51,8 @@ class ChangesForV530a extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -73,8 +73,8 @@ class ChangesForV530a extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -51,8 +51,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -65,8 +65,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
// in two steps for sqlite
@ -79,8 +79,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
if (Schema::hasColumn('bills', 'extension_date')) {
@ -92,8 +92,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -114,8 +114,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -128,8 +128,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -143,8 +143,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -157,8 +157,8 @@ class ChangesForV540 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -61,8 +61,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "jobs": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -79,8 +79,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -98,8 +98,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
if (Schema::hasColumn('budget_limits', 'generated')) {
@ -111,8 +111,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -147,8 +147,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "jobs": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
// drop failed jobs table.
@ -170,8 +170,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "failed_jobs": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -188,8 +188,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -209,8 +209,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// new webhooks table
@ -235,8 +235,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "webhooks": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -260,8 +260,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "webhook_messages": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
@ -283,8 +283,8 @@ class ChangesForV550 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "webhook_attempts": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -54,8 +54,8 @@ class ChangesForV550b2 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -80,8 +80,8 @@ class ChangesForV550b2 extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -44,8 +44,8 @@ class AddLdapColumnsToUsersTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -64,8 +64,8 @@ class AddLdapColumnsToUsersTable extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -58,8 +58,8 @@ class ExtendCurrencyInfo extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

@ -42,6 +42,7 @@ class UserGroups extends Migration
'budgets',
'categories',
'recurrences',
'object_groups',
'rule_groups',
'rules',
'tags',
@ -74,8 +75,8 @@ class UserGroups extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}
@ -94,8 +95,8 @@ class UserGroups extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -129,8 +130,8 @@ class UserGroups extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "user_groups": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
if (!Schema::hasTable('user_roles')) {
@ -147,8 +148,8 @@ class UserGroups extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "user_roles": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
if (!Schema::hasTable('group_memberships')) {
@ -170,8 +171,8 @@ class UserGroups extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not create table "group_memberships": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
try {
@ -187,10 +188,10 @@ class UserGroups extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
// ADD columns from tables
// ADD columns to tables
/** @var string $tableName */
foreach ($this->tables as $tableName) {
try {
@ -206,8 +207,8 @@ class UserGroups extends Migration
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
}

View File

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

View File

@ -26,7 +26,6 @@ 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;
/**
@ -51,8 +50,8 @@ return new class () extends Migration {
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
@ -76,8 +75,8 @@ return new class () extends Migration {
}
);
} 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.');
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
};

View File

@ -25,7 +25,6 @@ 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 {
@ -47,8 +46,8 @@ return new class () extends Migration {
$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.');
app('log')->error(sprintf('Could not create table "notifications": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -25,7 +25,6 @@ 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 {
@ -49,8 +48,8 @@ return new class () extends Migration {
$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.');
app('log')->error(sprintf('Could not create table "invited_users": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -25,7 +25,6 @@ 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 {
@ -54,8 +53,8 @@ return new class () extends Migration {
$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.');
app('log')->error(sprintf('Could not create table "audit_log_entries": %s', $e->getMessage()));
app('log')->error('If this table exists already (see the error message), this is not a problem. Other errors? Please open a discussion on GitHub.');
}
}
}

View File

@ -0,0 +1,58 @@
<?php
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;
/**
*
*/
return new class extends Migration {
/**
* Run the migrations.
*/
public function up(): void
{
try {
Schema::table(
'object_groups',
function (Blueprint $table) {
if (!Schema::hasColumn('object_groups', 'user_group_id')) {
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
$table->foreign('user_group_id', sprintf('%s_to_ugi', 'object_groups'))->references('id')->on('user_groups')->onDelete(
'set null'
)->onUpdate('cascade');
}
}
);
} catch (QueryException $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
/**
* Reverse the migrations.
*/
public function down(): void
{
try {
Schema::table(
'object_groups',
function (Blueprint $table) {
if ('sqlite' !== config('database.default')) {
$table->dropForeign(sprintf('%s_to_ugi', 'object_groups'));
}
if (Schema::hasColumn('object_groups', 'user_group_id')) {
$table->dropColumn('user_group_id');
}
}
);
} catch (QueryException | ColumnDoesNotExist $e) {
app('log')->error(sprintf('Could not execute query: %s', $e->getMessage()));
app('log')->error('If the column or index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.');
}
}
};

View File

@ -47,11 +47,11 @@ class ExchangeRateSeeder extends Seeder
app('log')->debug('Will not seed exchange rates yet.');
return;
}
$users = User::get();
$date = config('cer.date');
$rates = config('cer.rates');
$users = User::get();
$date = config('cer.date');
$rates = config('cer.rates');
$usable = [];
$euro = $this->getCurrency('EUR');
$euro = $this->getCurrency('EUR');
if (null === $euro) {
return;
}
@ -88,28 +88,28 @@ class ExchangeRateSeeder extends Seeder
}
/**
* @param User $user
* @param User $user
* @param TransactionCurrency $from
* @param TransactionCurrency $to
* @param string $date
* @param string $date
*
* @return bool
*/
private function hasRate(User $user, TransactionCurrency $from, TransactionCurrency $to, string $date): bool
{
return $user->currencyExchangeRates()
->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id)
->where('date', $date)
->count() > 0;
->where('from_currency_id', $from->id)
->where('to_currency_id', $to->id)
->where('date', $date)
->count() > 0;
}
/**
* @param User $user
* @param User $user
* @param TransactionCurrency $from
* @param TransactionCurrency $to
* @param string $date
* @param float $rate
* @param string $date
* @param float $rate
*
* @return void
*/
@ -117,12 +117,12 @@ class ExchangeRateSeeder extends Seeder
{
CurrencyExchangeRate::create(
[
'user_id' => $user->id,
'user_group_id' => $user->user_group_id ?? null,
'user_id' => $user->id,
'user_group_id' => $user->user_group_id ?? null,
'from_currency_id' => $from->id,
'to_currency_id' => $to->id,
'date' => $date,
'rate' => $rate,
'to_currency_id' => $to->id,
'date' => $date,
'rate' => $rate,
]
);
}