<?php
include_once __DIR__ . '/config/database.php';

try {
    $db = new PDO("mysql:host=localhost", "root", "");
    $db->exec("DROP DATABASE IF EXISTS iosco_bank");
    echo "Old database dropped.\n";
    
    $sql = file_get_contents(__DIR__ . '/../database.sql');
    $db->exec($sql);
    echo "New database created and seeded successfully!\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>
