tablename;$hashes[$name]=Illuminate\Support\Facades\DB::selectOne('SELECT md5(COALESCE(string_agg(md5(row_to_json(t)::text),\'\' ORDER BY row_to_json(t)::text),\'\')) AS hash FROM "'.str_replace('"','""',$name).'" t')->hash;} $before=json_decode(file_get_contents(__DIR__.'/BASELINE-QA.json'),true)['tables'];$changed=[]; foreach($hashes as$name=>$hash){if(($before[$name]??null)!==$hash)$changed[]=$name;} $result=['target'=>$target,'table_count'=>count($hashes),'changed_tables'=>$changed,'tables'=>$hashes]; file_put_contents(__DIR__.'/FINAL-QA.json',json_encode($result,JSON_PRETTY_PRINT));echo json_encode(['tables'=>count($hashes),'changed_tables'=>$changed]);