mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
chore: code cleanup.
This commit is contained in:
@@ -46,7 +46,7 @@ class ChangesForV410 extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasTable('notes')) {
|
||||
if (!Schema::hasTable('notes')) {
|
||||
try {
|
||||
Schema::create(
|
||||
'notes',
|
||||
|
@@ -89,7 +89,7 @@ class ChangesForV440 extends Migration
|
||||
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')) {
|
||||
if (!Schema::hasColumn('transactions', 'transaction_currency_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transactions',
|
||||
|
@@ -39,7 +39,7 @@ class ChangesForV450 extends Migration
|
||||
public function down(): void
|
||||
{
|
||||
// split up for sqlite compatibility
|
||||
if(Schema::hasColumn('transactions', 'foreign_amount')) {
|
||||
if (Schema::hasColumn('transactions', 'foreign_amount')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transactions',
|
||||
@@ -67,7 +67,7 @@ class ChangesForV450 extends Migration
|
||||
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.');
|
||||
}
|
||||
if(Schema::hasColumn('transactions', 'foreign_currency_id')) {
|
||||
if (Schema::hasColumn('transactions', 'foreign_currency_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transactions',
|
||||
@@ -89,7 +89,7 @@ class ChangesForV450 extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
// add "foreign_amount" to transactions
|
||||
if(!Schema::hasColumn('transactions', 'foreign_amount')) {
|
||||
if (!Schema::hasColumn('transactions', 'foreign_amount')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transactions',
|
||||
@@ -104,7 +104,7 @@ class ChangesForV450 extends Migration
|
||||
}
|
||||
|
||||
// add foreign transaction currency id to transactions (is nullable):
|
||||
if(!Schema::hasColumn('transactions', 'foreign_currency_id')) {
|
||||
if (!Schema::hasColumn('transactions', 'foreign_currency_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transactions',
|
||||
|
@@ -47,7 +47,7 @@ class CreateOauthAuthCodesTable extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasTable('oauth_auth_codes')) {
|
||||
if (!Schema::hasTable('oauth_auth_codes')) {
|
||||
try {
|
||||
Schema::create(
|
||||
'oauth_auth_codes',
|
||||
|
@@ -47,7 +47,7 @@ class CreateOauthAccessTokensTable extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasTable('oauth_access_tokens')) {
|
||||
if (!Schema::hasTable('oauth_access_tokens')) {
|
||||
try {
|
||||
Schema::create(
|
||||
'oauth_access_tokens',
|
||||
|
@@ -47,7 +47,7 @@ class CreateOauthRefreshTokensTable extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasTable('oauth_refresh_tokens')) {
|
||||
if (!Schema::hasTable('oauth_refresh_tokens')) {
|
||||
try {
|
||||
Schema::create(
|
||||
'oauth_refresh_tokens',
|
||||
|
@@ -47,7 +47,7 @@ class CreateOauthClientsTable extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasTable('oauth_clients')) {
|
||||
if (!Schema::hasTable('oauth_clients')) {
|
||||
try {
|
||||
Schema::create(
|
||||
'oauth_clients',
|
||||
|
@@ -47,7 +47,7 @@ class CreateOauthPersonalAccessClientsTable extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasTable('oauth_personal_access_clients')) {
|
||||
if (!Schema::hasTable('oauth_personal_access_clients')) {
|
||||
try {
|
||||
Schema::create(
|
||||
'oauth_personal_access_clients',
|
||||
|
@@ -41,7 +41,7 @@ class ChangesForV472 extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(!Schema::hasColumn('attachments', 'notes')) {
|
||||
if (!Schema::hasColumn('attachments', 'notes')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'attachments',
|
||||
@@ -55,7 +55,7 @@ class ChangesForV472 extends Migration
|
||||
}
|
||||
}
|
||||
|
||||
if(Schema::hasColumn('transactions', 'order')) {
|
||||
if (Schema::hasColumn('transactions', 'order')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budgets',
|
||||
@@ -77,7 +77,7 @@ class ChangesForV472 extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(Schema::hasColumn('attachments', 'notes')) {
|
||||
if (Schema::hasColumn('attachments', 'notes')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'attachments',
|
||||
@@ -91,7 +91,7 @@ class ChangesForV472 extends Migration
|
||||
}
|
||||
}
|
||||
|
||||
if(!Schema::hasColumn('budgets', 'order')) {
|
||||
if (!Schema::hasColumn('budgets', 'order')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budgets',
|
||||
|
@@ -42,7 +42,7 @@ class ChangesForV473 extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(!Schema::hasColumn('bills', 'transaction_currency_id')) {
|
||||
if (!Schema::hasColumn('bills', 'transaction_currency_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'bills',
|
||||
@@ -60,7 +60,7 @@ class ChangesForV473 extends Migration
|
||||
}
|
||||
}
|
||||
|
||||
if(!Schema::hasColumn('rules', 'strict')) {
|
||||
if (!Schema::hasColumn('rules', 'strict')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'rules',
|
||||
@@ -82,7 +82,7 @@ class ChangesForV473 extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasColumn('bills', 'transaction_currency_id')) {
|
||||
if (!Schema::hasColumn('bills', 'transaction_currency_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'bills',
|
||||
@@ -96,7 +96,7 @@ class ChangesForV473 extends Migration
|
||||
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')) {
|
||||
if (!Schema::hasColumn('rules', 'strict')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'rules',
|
||||
|
@@ -41,7 +41,7 @@ class ChangesForV477 extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(Schema::hasColumn('budget_limits', 'transaction_currency_id')) {
|
||||
if (Schema::hasColumn('budget_limits', 'transaction_currency_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_limits',
|
||||
@@ -68,7 +68,7 @@ class ChangesForV477 extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasColumn('budget_limits', 'transaction_currency_id')) {
|
||||
if (!Schema::hasColumn('budget_limits', 'transaction_currency_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_limits',
|
||||
|
@@ -41,7 +41,7 @@ class ChangesForV479 extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(Schema::hasColumn('transaction_currencies', 'enabled')) {
|
||||
if (Schema::hasColumn('transaction_currencies', 'enabled')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transaction_currencies',
|
||||
@@ -63,7 +63,7 @@ class ChangesForV479 extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasColumn('transaction_currencies', 'enabled')) {
|
||||
if (!Schema::hasColumn('transaction_currencies', 'enabled')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transaction_currencies',
|
||||
|
@@ -41,7 +41,7 @@ class FixLdapConfiguration extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(Schema::hasColumn('users', 'objectguid')) {
|
||||
if (Schema::hasColumn('users', 'objectguid')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
@@ -67,7 +67,7 @@ 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.
|
||||
*/
|
||||
if(!Schema::hasColumn('users', 'objectguid')) {
|
||||
if (!Schema::hasColumn('users', 'objectguid')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
|
@@ -41,7 +41,7 @@ class ChangesForV480 extends Migration
|
||||
public function down(): void
|
||||
{
|
||||
// remove group ID
|
||||
if(Schema::hasColumn('transaction_journals', 'transaction_group_id')) {
|
||||
if (Schema::hasColumn('transaction_journals', 'transaction_group_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transaction_journals',
|
||||
@@ -71,7 +71,7 @@ class ChangesForV480 extends Migration
|
||||
}
|
||||
|
||||
// remove 'stop processing' column
|
||||
if(Schema::hasColumn('rule_groups', 'stop_processing')) {
|
||||
if (Schema::hasColumn('rule_groups', 'stop_processing')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'rule_groups',
|
||||
@@ -91,7 +91,7 @@ class ChangesForV480 extends Migration
|
||||
}
|
||||
|
||||
// remove 'mfa_secret' column
|
||||
if(Schema::hasColumn('users', 'mfa_secret')) {
|
||||
if (Schema::hasColumn('users', 'mfa_secret')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
@@ -119,7 +119,7 @@ class ChangesForV480 extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
// add currency_id
|
||||
if(!Schema::hasColumn('transaction_journals', 'transaction_group_id')) {
|
||||
if (!Schema::hasColumn('transaction_journals', 'transaction_group_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'transaction_journals',
|
||||
@@ -148,7 +148,7 @@ class ChangesForV480 extends Migration
|
||||
}
|
||||
|
||||
// add 'stop processing' column
|
||||
if(!Schema::hasColumn('rule_groups', 'stop_processing')) {
|
||||
if (!Schema::hasColumn('rule_groups', 'stop_processing')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'rule_groups',
|
||||
@@ -163,7 +163,7 @@ class ChangesForV480 extends Migration
|
||||
}
|
||||
|
||||
// add 'mfa_secret' column
|
||||
if(!Schema::hasColumn('users', 'mfa_secret')) {
|
||||
if (!Schema::hasColumn('users', 'mfa_secret')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
|
@@ -42,7 +42,7 @@ class ChangesForV530a extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(Schema::hasColumn('bills', 'order')) {
|
||||
if (Schema::hasColumn('bills', 'order')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'bills',
|
||||
@@ -64,7 +64,7 @@ class ChangesForV530a extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasColumn('bills', 'order')) {
|
||||
if (!Schema::hasColumn('bills', 'order')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'bills',
|
||||
|
@@ -42,7 +42,7 @@ class ChangesForV540 extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(Schema::hasColumn('oauth_clients', 'provider')) {
|
||||
if (Schema::hasColumn('oauth_clients', 'provider')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'oauth_clients',
|
||||
@@ -56,7 +56,7 @@ class ChangesForV540 extends Migration
|
||||
}
|
||||
}
|
||||
|
||||
if(Schema::hasColumn('accounts', 'order')) {
|
||||
if (Schema::hasColumn('accounts', 'order')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'accounts',
|
||||
@@ -70,7 +70,7 @@ class ChangesForV540 extends Migration
|
||||
}
|
||||
}
|
||||
// in two steps for sqlite
|
||||
if(Schema::hasColumn('bills', 'end_date')) {
|
||||
if (Schema::hasColumn('bills', 'end_date')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'bills',
|
||||
@@ -83,7 +83,7 @@ class ChangesForV540 extends Migration
|
||||
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')) {
|
||||
if (Schema::hasColumn('bills', 'extension_date')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'bills',
|
||||
@@ -105,7 +105,7 @@ class ChangesForV540 extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasColumn('accounts', 'order')) {
|
||||
if (!Schema::hasColumn('accounts', 'order')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'accounts',
|
||||
@@ -119,7 +119,7 @@ class ChangesForV540 extends Migration
|
||||
}
|
||||
}
|
||||
|
||||
if(!Schema::hasColumn('oauth_clients', 'provider')) {
|
||||
if (!Schema::hasColumn('oauth_clients', 'provider')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'oauth_clients',
|
||||
@@ -133,7 +133,7 @@ class ChangesForV540 extends Migration
|
||||
}
|
||||
}
|
||||
|
||||
if(!Schema::hasColumn('bills', 'end_date') && !Schema::hasColumn('bills', 'extension_date')) {
|
||||
if (!Schema::hasColumn('bills', 'end_date') && !Schema::hasColumn('bills', 'extension_date')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'bills',
|
||||
|
@@ -67,7 +67,7 @@ class ChangesForV550 extends Migration
|
||||
}
|
||||
|
||||
// expand budget / transaction journal table.
|
||||
if(Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
|
||||
if (Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_transaction_journal',
|
||||
@@ -89,7 +89,7 @@ class ChangesForV550 extends Migration
|
||||
|
||||
// drop fields from budget limits
|
||||
// in two steps for sqlite
|
||||
if(Schema::hasColumn('budget_limits', 'period')) {
|
||||
if (Schema::hasColumn('budget_limits', 'period')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_limits',
|
||||
@@ -102,7 +102,7 @@ class ChangesForV550 extends Migration
|
||||
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')) {
|
||||
if (Schema::hasColumn('budget_limits', 'generated')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_limits',
|
||||
@@ -176,7 +176,7 @@ class ChangesForV550 extends Migration
|
||||
}
|
||||
|
||||
// update budget / transaction journal table.
|
||||
if(!Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
|
||||
if (!Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_transaction_journal',
|
||||
|
@@ -40,7 +40,7 @@ class ChangesForV550b2 extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
|
||||
if (Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'recurrences_transactions',
|
||||
@@ -68,7 +68,7 @@ class ChangesForV550b2 extends Migration
|
||||
public function up(): void
|
||||
{
|
||||
// expand recurrence transaction table
|
||||
if(!Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
|
||||
if (!Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'recurrences_transactions',
|
||||
|
@@ -35,7 +35,7 @@ class AddLdapColumnsToUsersTable extends Migration
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if(Schema::hasColumn('users', 'domain')) {
|
||||
if (Schema::hasColumn('users', 'domain')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
@@ -55,7 +55,7 @@ class AddLdapColumnsToUsersTable extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
if(!Schema::hasColumn('users', 'domain')) {
|
||||
if (!Schema::hasColumn('users', 'domain')) {
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
|
Reference in New Issue
Block a user