diff --git a/database/migrations/2026_01_12_031836_add_username_to_users_table.php b/database/migrations/2026_01_12_031836_add_username_to_users_table.php index 5773e07..775c9fc 100644 --- a/database/migrations/2026_01_12_031836_add_username_to_users_table.php +++ b/database/migrations/2026_01_12_031836_add_username_to_users_table.php @@ -11,9 +11,11 @@ return new class extends Migration */ public function up(): void { - Schema::table('users', function (Blueprint $table) { - // - }); + if (!Schema::hasColumn('users', 'username')) { + Schema::table('users', function (Blueprint $table) { + $table->string('username')->unique()->nullable()->after('id'); + }); + } } /** @@ -21,8 +23,10 @@ return new class extends Migration */ public function down(): void { - Schema::table('users', function (Blueprint $table) { - // - }); + if (Schema::hasColumn('users', 'username')) { + Schema::table('users', function (Blueprint $table) { + $table->dropColumn('username'); + }); + } } };