set default charset and collation into db migrations

This commit is contained in:
Peter Papp
2021-07-23 17:41:42 +02:00
parent 7b65d868c4
commit 5c848f75a6
20 changed files with 43 additions and 0 deletions

View File

@@ -21,6 +21,8 @@ class CreateUsersTable extends Migration
$table->string('password');
$table->rememberToken();
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -17,6 +17,8 @@ class CreatePasswordResetsTable extends Migration
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -21,6 +21,9 @@ class AddTwoFactorColumnsToUsersTable extends Migration
$table->text('two_factor_recovery_codes')
->after('two_factor_secret')
->nullable();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -18,6 +18,8 @@ class CreateCustomerColumns extends Migration
$table->string('card_brand')->nullable();
$table->string('card_last_four', 4)->nullable();
$table->timestamp('trial_ends_at')->nullable();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -26,6 +26,8 @@ class CreateSubscriptionsTable extends Migration
$table->timestamps();
$table->index(['user_id', 'stripe_status']);
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -22,6 +22,8 @@ class CreateSubscriptionItemsTable extends Migration
$table->timestamps();
$table->unique(['subscription_id', 'stripe_plan']);
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -26,6 +26,9 @@ class CreateFileManagerFolders extends Migration
$table->softDeletes();
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -33,6 +33,9 @@ class CreateFileManagerFiles extends Migration
$table->softDeletes();
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -20,6 +20,8 @@ class CreateFailedJobsTable extends Migration
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -21,6 +21,8 @@ class CreatePersonalAccessTokensTable extends Migration
$table->text('abilities')->nullable();
$table->timestamp('last_used_at')->nullable();
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -16,6 +16,8 @@ class CreateFavouritesFoldersTable extends Migration
Schema::create('favourite_folder', function (Blueprint $table) {
$table->uuid('user_id');
$table->uuid('folder_id');
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -24,6 +24,8 @@ class CreateSharesTable extends Migration
$table->string('password')->nullable();
$table->integer('expire_in')->nullable();
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -25,6 +25,8 @@ class CreateUserSettingsTable extends Migration
$table->text('country')->nullable();
$table->text('phone_number')->nullable();
$table->decimal('timezone', 10, 1)->nullable();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -16,6 +16,8 @@ class CreateSettingsTable extends Migration
Schema::create('settings', function (Blueprint $table) {
$table->string('name')->unique()->primary()->index();
$table->longText('value')->nullable();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -18,6 +18,8 @@ class CreatePagesTable extends Migration
$table->string('title');
$table->boolean('visibility');
$table->longText('content');
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -19,6 +19,8 @@ class CreateTrafficTable extends Migration
$table->bigInteger('upload')->default(0);
$table->bigInteger('download')->default(0);
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -21,6 +21,8 @@ class CreateJobsTable extends Migration
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -19,6 +19,8 @@ class CreateZipsTable extends Migration
$table->string('shared_token')->nullable()->index();
$table->text('basename');
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -18,6 +18,8 @@ class CreateLanguagesTable extends Migration
$table->string('name');
$table->string('locale')->unique();
$table->timestamps();
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}

View File

@@ -17,6 +17,8 @@ class CreateLanguageStrings extends Migration
$table->string('key');
$table->longText('value');
$table->string('lang');
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
}