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

try {
    $pdo = db();
    $sql = <<<SQL
CREATE TABLE IF NOT EXISTS `published_pages` (
    `id` INT AUTO_INCREMENT PRIMARY KEY,
    `filename` VARCHAR(255) NOT NULL UNIQUE,
    `management_token` VARCHAR(255) NOT NULL UNIQUE,
    `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    `expires_at` TIMESTAMP NOT NULL
);
SQL;
    $pdo->exec($sql);
    echo "Table `published_pages` created successfully or already exists.\n";
} catch (PDOException $e) {
    die("DB ERROR: " . $e->getMessage());
}

