diff --git a/database/factories/UserFactory.php b/database/factories/UserFactory.php index eedac39..de17187 100644 --- a/database/factories/UserFactory.php +++ b/database/factories/UserFactory.php @@ -28,7 +28,6 @@ class UserFactory extends Factory 'remember_token' => Str::random(10), 'user_role_id' => null, 'profile_photo_path' => null, - 'current_team_id' => null, ]; } diff --git a/database/migrations/2024_06_17_021924_create_user_roles_table.php b/database/migrations/0000_00_00_000000_create_user_roles_table.php similarity index 100% rename from database/migrations/2024_06_17_021924_create_user_roles_table.php rename to database/migrations/0000_00_00_000000_create_user_roles_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 3b49aca..56b2ca6 100644 --- a/database/migrations/0001_01_01_000000_create_users_table.php +++ b/database/migrations/0001_01_01_000000_create_users_table.php @@ -1,5 +1,6 @@ string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); + $table->foreignIdFor(UserRole::class)->nullable()->default(null)->constrained('user_roles'); $table->rememberToken(); - $table->foreignId('current_team_id')->nullable(); $table->string('profile_photo_path', 2048)->nullable(); $table->timestamps(); }); diff --git a/database/migrations/2024_06_17_023510_update_users_table_with_user_role.php b/database/migrations/2024_06_17_023510_update_users_table_with_user_role.php deleted file mode 100644 index 9daa80b..0000000 --- a/database/migrations/2024_06_17_023510_update_users_table_with_user_role.php +++ /dev/null @@ -1,28 +0,0 @@ -foreignIdFor(UserRole::class) - ->nullable() - ->after('remember_token') - ->constrained() - ->cascadeOnUpdate() - ->nullOnDelete(); - }); - } - - public function down(): void - { - Schema::table('users', function (Blueprint $table) { - $table->dropForeign(['user_role_id']); - }); - } -};