<?php
$pdo = require __DIR__ . '/config/pdo.php';

try {
    $sql = "CREATE TABLE IF NOT EXISTS sliders (
        id INT AUTO_INCREMENT PRIMARY KEY,
        image VARCHAR(255) NOT NULL,
        title VARCHAR(100) DEFAULT NULL,
        description TEXT DEFAULT NULL,
        link_url VARCHAR(255) DEFAULT NULL,
        is_active TINYINT(1) DEFAULT 1,
        sort_order INT DEFAULT 0,
        created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;";

    $pdo->exec($sql);
    echo "Tabel 'sliders' berhasil dibuat!";
} catch (PDOException $e) {
    echo "Gagal membuat tabel: " . $e->getMessage();
}
