8 lines
657 B
PHP
8 lines
657 B
PHP
<?php
|
|
require __DIR__.'/boot-QA.php';
|
|
use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Schema;
|
|
$names=DB::select("SELECT tablename FROM pg_tables WHERE schemaname='public' ORDER BY tablename");$all=[];foreach($names as$n)$all[]=$n->tablename;
|
|
$tables=[];foreach($all as$n)if(preg_match('/preference|setting|account|profile|desk_|simulation|land_assistance|investment_submissions|geo_locations|opportunities/',$n))$tables[$n]=Schema::getColumnListing($n);
|
|
file_put_contents(__DIR__.'/SCHEMA-READONLY.json',json_encode(['target'=>$target,'tables'=>$tables],JSON_PRETTY_PRINT));
|
|
echo json_encode(['tables'=>$tables,'all_tables'=>count($all)]);
|