mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-03 03:00:14 +00:00
Code cleanup
This commit is contained in:
@@ -152,7 +152,7 @@ class ChangesForV540 extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'oauth_clients',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
$table->string('secret', 100)->nullable()->change();
|
||||
}
|
||||
);
|
||||
|
@@ -71,7 +71,7 @@ class ChangesForV550 extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_transaction_journal',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if ('sqlite' !== config('database.default')) {
|
||||
$table->dropForeign('budget_id_foreign');
|
||||
}
|
||||
@@ -136,7 +136,7 @@ class ChangesForV550 extends Migration
|
||||
try {
|
||||
Schema::create(
|
||||
'jobs',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
@@ -159,7 +159,7 @@ class ChangesForV550 extends Migration
|
||||
try {
|
||||
Schema::create(
|
||||
'failed_jobs',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
@@ -180,7 +180,7 @@ class ChangesForV550 extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'budget_transaction_journal',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('budget_transaction_journal', 'budget_limit_id')) {
|
||||
$table->integer('budget_limit_id', false, true)->nullable()->default(null)->after('budget_id');
|
||||
$table->foreign('budget_limit_id', 'budget_id_foreign')->references('id')->on('budget_limits')->onDelete('set null');
|
||||
|
@@ -44,7 +44,7 @@ class ChangesForV550b2 extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'recurrences_transactions',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if ('sqlite' !== config('database.default')) {
|
||||
$table->dropForeign('type_foreign');
|
||||
}
|
||||
@@ -72,7 +72,7 @@ class ChangesForV550b2 extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'recurrences_transactions',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('recurrences_transactions', 'transaction_type_id')) {
|
||||
$table->integer('transaction_type_id', false, true)->nullable()->after('transaction_currency_id');
|
||||
$table->foreign('transaction_type_id', 'type_foreign')->references('id')->on('transaction_types')->onDelete('set null');
|
||||
|
@@ -39,7 +39,7 @@ class AddLdapColumnsToUsersTable extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
$table->dropColumn(['domain']);
|
||||
}
|
||||
);
|
||||
@@ -59,7 +59,7 @@ class AddLdapColumnsToUsersTable extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
$table->string('domain')->nullable();
|
||||
}
|
||||
);
|
||||
|
@@ -52,7 +52,7 @@ class ExtendCurrencyInfo extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'transaction_currencies',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
$table->string('code', 51)->change();
|
||||
$table->string('symbol', 51)->change();
|
||||
}
|
||||
|
@@ -65,7 +65,7 @@ class UserGroups extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
$tableName,
|
||||
function (Blueprint $table) use ($tableName) {
|
||||
static function (Blueprint $table) use ($tableName) {
|
||||
if ('sqlite' !== config('database.default')) {
|
||||
$table->dropForeign(sprintf('%s_to_ugi', $tableName));
|
||||
}
|
||||
@@ -85,7 +85,7 @@ class UserGroups extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if ('sqlite' !== config('database.default')) {
|
||||
$table->dropForeign('type_user_group_id');
|
||||
}
|
||||
@@ -178,7 +178,7 @@ class UserGroups extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
'users',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('users', 'user_group_id')) {
|
||||
$table->bigInteger('user_group_id', false, true)->nullable();
|
||||
$table->foreign('user_group_id', 'type_user_group_id')->references('id')->on('user_groups')->onDelete('set null')->onUpdate(
|
||||
@@ -197,7 +197,7 @@ class UserGroups extends Migration
|
||||
try {
|
||||
Schema::table(
|
||||
$tableName,
|
||||
function (Blueprint $table) use ($tableName) {
|
||||
static function (Blueprint $table) use ($tableName) {
|
||||
if (!Schema::hasColumn($tableName, 'user_group_id')) {
|
||||
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
|
||||
$table->foreign('user_group_id', sprintf('%s_to_ugi', $tableName))->references('id')->on('user_groups')->onDelete(
|
||||
|
@@ -51,7 +51,7 @@ class CreateLocalPersonalAccessTokensTable extends Migration
|
||||
{
|
||||
if (!Schema::hasTable('personal_access_tokens')) {
|
||||
try {
|
||||
Schema::create('personal_access_tokens', function (Blueprint $table) {
|
||||
Schema::create('personal_access_tokens', static function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->morphs('tokenable');
|
||||
$table->string('name');
|
||||
|
@@ -42,7 +42,7 @@ return new class () extends Migration {
|
||||
try {
|
||||
Schema::table(
|
||||
'currency_exchange_rates',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if (!Schema::hasColumn('currency_exchange_rates', 'user_group_id')) {
|
||||
$table->bigInteger('user_group_id', false, true)->nullable()->after('user_id');
|
||||
$table->foreign('user_group_id', 'cer_to_ugi')->references('id')->on('user_groups')->onDelete('set null')->onUpdate('cascade');
|
||||
@@ -65,7 +65,7 @@ return new class () extends Migration {
|
||||
try {
|
||||
Schema::table(
|
||||
'currency_exchange_rates',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if ('sqlite' !== config('database.default')) {
|
||||
$table->dropForeign('cer_to_ugi');
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ return new class () extends Migration {
|
||||
{
|
||||
if (!Schema::hasTable('notifications')) {
|
||||
try {
|
||||
Schema::create('notifications', function (Blueprint $table) {
|
||||
Schema::create('notifications', static function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('type');
|
||||
$table->morphs('notifiable');
|
||||
|
@@ -37,7 +37,7 @@ return new class () extends Migration {
|
||||
{
|
||||
if (!Schema::hasTable('invited_users')) {
|
||||
try {
|
||||
Schema::create('invited_users', function (Blueprint $table) {
|
||||
Schema::create('invited_users', static function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->integer('user_id', false, true);
|
||||
|
@@ -37,7 +37,7 @@ return new class () extends Migration {
|
||||
{
|
||||
if (!Schema::hasTable('audit_log_entries')) {
|
||||
try {
|
||||
Schema::create('audit_log_entries', function (Blueprint $table) {
|
||||
Schema::create('audit_log_entries', static function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
|
@@ -41,7 +41,7 @@ return new class () extends Migration {
|
||||
try {
|
||||
Schema::table(
|
||||
'object_groups',
|
||||
function (Blueprint $table) {
|
||||
static 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(
|
||||
@@ -64,7 +64,7 @@ return new class () extends Migration {
|
||||
try {
|
||||
Schema::table(
|
||||
'object_groups',
|
||||
function (Blueprint $table) {
|
||||
static function (Blueprint $table) {
|
||||
if ('sqlite' !== config('database.default')) {
|
||||
$table->dropForeign(sprintf('%s_to_ugi', 'object_groups'));
|
||||
}
|
||||
|
@@ -37,7 +37,7 @@ return new class () extends Migration {
|
||||
// transaction_currency_user
|
||||
if (!Schema::hasTable('transaction_currency_user')) {
|
||||
try {
|
||||
Schema::create('transaction_currency_user', function (Blueprint $table) {
|
||||
Schema::create('transaction_currency_user', static function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->integer('user_id', false, true);
|
||||
@@ -56,7 +56,7 @@ return new class () extends Migration {
|
||||
// transaction_currency_user_group
|
||||
if (!Schema::hasTable('transaction_currency_user_group')) {
|
||||
try {
|
||||
Schema::create('transaction_currency_user_group', function (Blueprint $table) {
|
||||
Schema::create('transaction_currency_user_group', static function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->timestamps();
|
||||
$table->bigInteger('user_group_id', false, true);
|
||||
|
Reference in New Issue
Block a user