<?php
require_once __DIR__ . '/vendor/autoload.php';

$envFile = __DIR__ . '/.env';
if (file_exists($envFile)) {
    $dotenv = Dotenv\Dotenv::createImmutable(__DIR__);
    $dotenv->safeLoad();
}

use App\Database;

try {
    $pdo = Database::getConnection();
    $sql = file_get_contents(__DIR__ . '/migrations/021_create_external_lab_services.sql');
    $pdo->exec($sql);
    echo "✓ Migration 021 (external_lab_services) completed successfully\n";
} catch (Exception $e) {
    echo "✗ Migration 021 failed: " . $e->getMessage() . "\n";
    exit(1);
}
