<?php
require __DIR__ . '/../bootstrap.php';

use Gestoreasy\Core\Tenant\ConnectionManager;

$tenant = $argv[1] ?? 'default';
$pdo = ConnectionManager::forTenant($tenant);
$stmt = $pdo->query('SELECT module, filename, applied_at FROM schema_migrations ORDER BY module, filename');
$rows = $stmt->fetchAll();
echo json_encode($rows, JSON_UNESCAPED_UNICODE) . "\n";