<?php
require_once 'config/database.php';

// Add password field to admission_applications table if it doesn't exist
try {
    $pdo->exec("ALTER TABLE admission_applications ADD COLUMN password VARCHAR(255) DEFAULT NULL AFTER application_no");
    echo 'Password field added to admission_applications table successfully.' . PHP_EOL;
} catch (Exception $e) {
    // Check if the error is because the column already exists
    if (strpos($e->getMessage(), 'Duplicate column name') !== false) {
        echo 'Password field already exists in admission_applications table.' . PHP_EOL;
    } else {
        echo 'Error adding password field: ' . $e->getMessage() . PHP_EOL;
    }
}
?>