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

use Gestoreasy\Core\Tenant\TenantAdmin;

$tenant = $argv[1] ?? 'default';
try {
    $res = TenantAdmin::runMigrations($tenant);
    echo json_encode(['ok' => true, 'result' => $res], JSON_UNESCAPED_UNICODE) . "\n";
} catch (\Throwable $e) {
    echo json_encode(['ok' => false, 'error' => $e->getMessage()], JSON_UNESCAPED_UNICODE) . "\n";
}