make(Kernel::class)->bootstrap(); $identity = portalQaAssertTarget($target); $migration = '2026_10_10_050000_extend_organization_country'; $before = DB::table('migrations')->where('migration', $migration)->exists(); config(['organization_country.authenticated_installation' => true]); try { $exit = Artisan::call('migrate', ['--path' => 'database/migrations/'.$migration.'.php', '--force' => true]); } finally { config(['organization_country.authenticated_installation' => false]); } throw_unless($exit === 0 && Schema::hasColumn('organizations', 'incorporation_country_provenance'), RuntimeException::class, 'QA country extension failed.'); $proof = ['target' => $identity, 'migration' => $migration, 'was_installed' => $before, 'changed' => ! $before, 'new_columns' => 2, 'new_tables' => 0, 'new_organizations' => 0, 'active_writes' => 0, 'mechanism' => 'Guarded QA CLI only; authenticated active installation remains separate']; file_put_contents($root.'/storage/app/private/investmoz-v2/portal-audit/next-country-install-qa.json', json_encode($proof, JSON_PRETTY_PRINT)); echo json_encode($proof).PHP_EOL;