<?php
require_once '../core/bootstrap.php';

$db = new Database();
echo "<h1>Installing Password Resets Table</h1>";

try {
    $db->query("CREATE TABLE `password_resets` (
      `email` varchar(100) NOT NULL,
      `token` varchar(255) NOT NULL,
      `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
      KEY `email` (`email`)
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4");
    $db->execute();
    echo "Success: Created 'password_resets' table.<br>";
} catch (Exception $e) {
    echo "Info: Table might already exist. Error: " . $e->getMessage() . "<br>";
}
?>