<?php
try {
    $pdo = new PDO('mysql:host=127.0.0.1;dbname=projects_membershipdb;charset=utf8mb4', 'root', '', [PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION]);

    $pdo->exec("ALTER TABLE loans ADD COLUMN repayment_frequency ENUM('daily','weekly','bi-weekly','monthly','quarterly') NOT NULL DEFAULT 'monthly' AFTER duration_months");
    echo "Added repayment_frequency column to loans\n";

    echo "Migration 020 completed successfully\n";
} catch (Exception $e) {
    echo 'Error: ' . $e->getMessage() . "\n";
    exit(1);
}
