*/ if (PHP_SAPI !== 'cli') { http_response_code(404); exit('Not Found'); } require_once __DIR__ . '/../../app/bootstrap/init.php'; use App\Core\Database; try { $db = Database::getInstance(); $sql = file_get_contents(__DIR__ . '/../../database/migrations/008_invoice_lines_enhance.sql'); // Split by semicolon and execute $queries = array_filter(array_map('trim', explode(';', $sql))); echo "

Running Migration 008...

"; echo ""; echo "

Migration completed successfully!

"; echo "

Please delete this file (public/migrate_008.php) for security.

"; } catch (\Exception $e) { echo "

Migration failed:

"; echo "
" . htmlspecialchars($e->getMessage()) . "
"; }