Files
Investidor-V2/outputs/investmoz-parques-L1-QA-20261016/baseline.php
T
nala cef6e201c7
tests / ci (push) Canceled after 0s
versao nrgocios 2
2026-10-16 20:11:05 +02:00

12 lines
1.2 KiB
PHP

<?php
require __DIR__.'/boot-QA.php';
use Illuminate\Support\Facades\DB;
$tables=DB::select("SELECT tablename FROM pg_tables WHERE schemaname='public' ORDER BY tablename");$hashes=[];
foreach($tables as$t){$name=$t->tablename;$hashes[$name]=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;}
file_put_contents(__DIR__.'/BASELINE-QA.json',json_encode(['target'=>$target,'tables'=>$hashes],JSON_PRETTY_PRINT));
$orgs=DB::table('organizations')->whereNull('deleted_at')->get(['id','name','data_classification']);
$zones=DB::table('investment_zones')->where('category','industrial_park')->get(['id','name','version_no','publication_status','operator_id']);
$data=['organizations'=>$orgs,'zones'=>$zones,'migration_130000'=>DB::table('migrations')->where('migration',App\Services\InvestmentZoneOperationalProfile::MIGRATION)->count(),'new_column'=>Illuminate\Support\Facades\Schema::hasColumn('investment_zones','operational_details')];
file_put_contents(__DIR__.'/BASE-QA-FACTS.json',json_encode($data,JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE));
echo json_encode($data,JSON_UNESCAPED_UNICODE);