#!/bin/sh
cd /www/wwwroot/faithfulness
sudo -u www /usr/bin/php artisan tinker --execute="
echo 'route_caches exists: '.(Schema::hasTable('location_route_caches')?'YES':'NO').PHP_EOL;
echo 'geo cache table name check: '.(Schema::hasTable('location_geo_caches')?'YES':'NO').PHP_EOL;
\$tables = DB::select('SHOW TABLES');
foreach (\$tables as \$t) { \$name = array_values((array)\$t)[0]; if (strpos(\$name, 'location') !== false || strpos(\$name, 'geo') !== false) { echo 'TABLE: '.\$name.PHP_EOL; } }
" 2>&1 | grep -E "exists|TABLE"
