bootstrap($app);(new Illuminate\Foundation\Bootstrap\LoadConfiguration)->bootstrap($app); $c=config('database.connections.'.config('database.default')); if($c['driver']!=='pgsql'||$c['database']!=='investemoz'||(int)$c['port']!==5432||!in_array($c['host'],['127.0.0.1','localhost'])||!empty($c['url']))throw new RuntimeException('Destination guard'); $db=new PDO('pgsql:host='.$c['host'].';port=5432;dbname=investemoz',$c['username'],$c['password'],[PDO::ATTR_ERRMODE=>PDO::ERRMODE_EXCEPTION]);$db->exec('BEGIN READ ONLY'); try{echo json_encode(['read_only'=>true,'ledger'=>(int)$db->query("SELECT count(*) FROM migrations WHERE migration='2026_10_16_130000_add_investment_zone_editorial_draft'")->fetchColumn(), 'column'=>(int)$db->query("SELECT count(*) FROM information_schema.columns WHERE table_schema='public' AND table_name='investment_zones' AND column_name='editorial_draft'")->fetchColumn(), 'installation_events'=>(int)$db->query("SELECT count(*) FROM audit_events WHERE source_system='investment-zone-profile-installation'")->fetchColumn()]).PHP_EOL;}finally{$db->exec('ROLLBACK');}