<?php
/**
 * Add Form Theme Field to Stores Table
 * This script adds a field for store owners to choose between white or dark form theme
 * 
 * Field added:
 * - form_theme: Form theme (default: 'dark', options: 'dark' or 'white')
 */

require_once 'config.php';

echo "=== Adding Form Theme Field ===\n\n";

// Check if form_theme column exists
$checkCol = $conn->query("SHOW COLUMNS FROM stores LIKE 'form_theme'");
if ($checkCol->num_rows == 0) {
    $alterSql = "ALTER TABLE stores ADD COLUMN form_theme ENUM('dark', 'white') DEFAULT 'dark' AFTER background_color";
    if ($conn->query($alterSql)) {
        echo "✓ Added 'form_theme' column\n";
    } else {
        echo "✗ Error adding form_theme: " . $conn->error . "\n";
        exit(1);
    }
} else {
    echo "✓ 'form_theme' column already exists\n";
}

echo "\n=== Done! ===\n";
echo "Store owners can now choose between white or dark form theme.\n";
?>


