I have a user_id set in log table and now have a problem that I sometimes need to store logs to actions performed by non-logged users.
When I run this migration
Schema::table('users_log', function (Blueprint $table) {
$table->unsignedInteger('user_id')->nullable()->change();
});
I get an error
[Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 1832 Cannot change column 'user_id': used in a foreign key constraint 'users_log_user_id_foreign' (SQL: ALTER TABLE users_log CHANGE user_id user_id INT UNSIGNED DEFAULT NULL)