12 lines
1.2 KiB
PHP
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);
|