id(); $table->string('code'); }); Schema::create('events', function (Blueprint $table): void { $table->id(); $table->foreignId('client_id')->nullable(); $table->string('tenant_code'); $table->string('title'); }); DB::table('clients')->insert([ ['id' => 10, 'code' => 'pyme_rural'], ['id' => 11, 'code' => 'onticket'], ]); DB::table('events')->insert([ [ 'id' => 20, 'client_id' => null, 'tenant_code' => 'onticket', 'title' => '26.º Fiesta de la Tradición y 4.º Encuentro de Agrupaciones Gauchas', ], [ 'id' => 21, 'client_id' => 11, 'tenant_code' => 'onticket', 'title' => 'Otro evento', ], ]); $migration = require database_path('migrations/2026_09_28_000200_assign_arrufo_event_to_pyme_rural_client.php'); $migration->up(); $this->assertDatabaseHas('events', ['id' => 20, 'client_id' => 10]); $this->assertDatabaseHas('events', ['id' => 21, 'client_id' => 11]); } }