<?php

declare(strict_types=1);

require __DIR__ . '/dev-db.php';

$pdo = dev_pdo();
$applied = dev_apply_migrations($pdo);

if ($applied === []) {
    echo "No new migrations. Database is up to date.\n";
    exit(0);
}

foreach ($applied as $version) {
    echo "Applied migration: {$version}\n";
}

echo "Applied " . count($applied) . " migration(s).\n";

