39038-vm/db/migrations/add_landing_sections.php
2026-03-08 03:22:33 +00:00

26 lines
910 B
PHP

<?php
require_once __DIR__ . '/../config.php';
$pdo = db();
try {
$pdo->exec("
CREATE TABLE IF NOT EXISTS landing_sections (
id INT AUTO_INCREMENT PRIMARY KEY,
section_type VARCHAR(50) NOT NULL DEFAULT 'custom',
title VARCHAR(255) NOT NULL,
subtitle TEXT NULL,
content TEXT NULL,
image_path VARCHAR(255) NULL,
layout ENUM('text_left', 'text_right', 'center') NOT NULL DEFAULT 'text_left',
button_text VARCHAR(100) NULL,
button_link VARCHAR(255) NULL,
section_order INT NOT NULL DEFAULT 0,
is_active TINYINT(1) NOT NULL DEFAULT 1,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
");
echo "landing_sections table created.\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}