diff --git a/database/migrations/2023_01_15_041933_add_missing_profile_id_to_users_table.php b/database/migrations/2023_01_15_041933_add_missing_profile_id_to_users_table.php new file mode 100644 index 000000000..9ea582e43 --- /dev/null +++ b/database/migrations/2023_01_15_041933_add_missing_profile_id_to_users_table.php @@ -0,0 +1,39 @@ +chunk(20, function($users) { + foreach($users as $user) { + $profile = Profile::whereUsername($user->username)->first(); + if($profile) { + $user->profile_id = $profile->id; + $user->save(); + } + } + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + } +};