From a373b607506bc268341467b29f8c286bc11dbce2 Mon Sep 17 00:00:00 2001 From: Jonathan van Rij Date: Thu, 19 Mar 2026 12:03:47 +0100 Subject: [PATCH] Add a separate migration for the user name on the users table --- .../0001_01_01_000000_create_users_table.php | 1 - ..._19_000000_add_username_to_users_table.php | 31 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 database/migrations/2026_03_19_000000_add_username_to_users_table.php diff --git a/database/migrations/0001_01_01_000000_create_users_table.php b/database/migrations/0001_01_01_000000_create_users_table.php index 68dec9a..28fa7b4 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -17,7 +17,6 @@ public function up(): void $table->id(); $table->foreignId('role_id')->default(1)->constrained(); $table->string('name'); - $table->string('username')->unique(); $table->string('email')->unique(); $table->string('azure_id')->nullable()->unique(); $table->string('photo')->nullable(); diff --git a/database/migrations/2026_03_19_000000_add_username_to_users_table.php b/database/migrations/2026_03_19_000000_add_username_to_users_table.php new file mode 100644 index 0000000..fa3bf19 --- /dev/null +++ b/database/migrations/2026_03_19_000000_add_username_to_users_table.php @@ -0,0 +1,31 @@ +string('username')->unique()->nullable()->after('name'); + }); + } + + /** + * Remove the username column from the users table. + */ + public function down(): void + { + Schema::table('users', function (Blueprint $table): void { + $table->dropColumn('username'); + }); + } +};