Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
adrolli committed Mar 6, 2024
1 parent 065c943 commit bf58946
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions database/migrations/2024_03_04_235738_update_user_table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,51 @@
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('users', function (Blueprint $table) {
// name and email are part of Laravel's default
if (!Schema::hasColumn('users', 'slug')) {
if (! Schema::hasColumn('users', 'slug')) {
$table->string('slug')->after('name');
}
if (!Schema::hasColumn('users', 'gender')) {
if (! Schema::hasColumn('users', 'gender')) {
$table->enum('gender', ['male', 'female', 'other'])->after('slug');
}
if (!Schema::hasColumn('users', 'title')) {
if (! Schema::hasColumn('users', 'title')) {
$table->string('title')->nullable()->after('gender');
}
if (!Schema::hasColumn('users', 'first_name')) {
if (! Schema::hasColumn('users', 'first_name')) {
$table->string('first_name')->after('title');
}
if (!Schema::hasColumn('users', 'last_name')) {
if (! Schema::hasColumn('users', 'last_name')) {
$table->string('last_name')->after('first_name');
}
if (!Schema::hasColumn('users', 'website')) {
if (! Schema::hasColumn('users', 'website')) {
$table->string('website')->nullable()->after('email');
}
if (!Schema::hasColumn('users', 'description')) {
if (! Schema::hasColumn('users', 'description')) {
$table->text('description')->nullable()->after('website');
}
// `email_verified_at`, `password`, and `remember_token` are part of Laravel's default
if (!Schema::hasColumn('users', 'two_factor_secret')) {
if (! Schema::hasColumn('users', 'two_factor_secret')) {
$table->text('two_factor_secret')->nullable()->after('remember_token');
}
if (!Schema::hasColumn('users', 'two_factor_recovery_codes')) {
if (! Schema::hasColumn('users', 'two_factor_recovery_codes')) {
$table->text('two_factor_recovery_codes')->nullable()->after('two_factor_secret');
}
if (!Schema::hasColumn('users', 'two_factor_confirmed_at')) {
if (! Schema::hasColumn('users', 'two_factor_confirmed_at')) {
$table->timestamp('two_factor_confirmed_at')->nullable()->after('two_factor_recovery_codes');
}
// Skipping `current_team_id` as it's from Jetstream
if (!Schema::hasColumn('users', 'avatar_url')) {
if (! Schema::hasColumn('users', 'avatar_url')) {
$table->string('avatar_url', 2048)->nullable()->after('two_factor_confirmed_at');
}
if (!Schema::hasColumn('users', 'profile_photo_path')) {
if (! Schema::hasColumn('users', 'profile_photo_path')) {
$table->string('profile_photo_path')->nullable()->after('avatar_url');
}
});
Expand Down

0 comments on commit bf58946

Please sign in to comment.