mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-29 18:20:01 +00:00
Expand financial administrations views.
This commit is contained in:
@@ -9,7 +9,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class () extends Migration {
|
||||
private const string QUERY_ERROR = 'Could not execute query (table "%s", field "%s"): %s';
|
||||
private const string EXPL = 'If the index already exists (see error), this is not an problem. Otherwise, please open a GitHub discussion.';
|
||||
private const string EXPL = 'If the index already exists (see error), or if MySQL can\'t do it, this is not an problem. Otherwise, please open a GitHub discussion.';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
|
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
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(
|
||||
'user_groups',
|
||||
static function (Blueprint $table): void {
|
||||
if (!Schema::hasColumn('user_groups', 'default_administration')) {
|
||||
$table->boolean('default_administration')->default(false)->after('title');
|
||||
}
|
||||
}
|
||||
);
|
||||
} 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
|
||||
{
|
||||
//
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user