<?php

defined('APP_PATH') || define('APP_PATH', dirname(__DIR__, 3));

require APP_PATH . '/core/Database.php';

$db = new Database();

try {
    // 添加 circle_id 字段
    $db->query("ALTER TABLE `" . DB_PREFIX . "posts` ADD COLUMN `circle_id` INT(11) DEFAULT 0 AFTER `location_name`");
    
    // 添加 circle_name 字段
    $db->query("ALTER TABLE `" . DB_PREFIX . "posts` ADD COLUMN `circle_name` VARCHAR(100) DEFAULT '' AFTER `circle_id`");
    
    echo "Successfully added circle_id and circle_name fields to posts table\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
    exit(1);
}