-- 为calendar_info表添加color字段的迁移脚本
-- 执行时间: 2025-01-20

BEGIN;

-- 添加color字段到calendar_info表
ALTER TABLE public.calendar_info 
ADD COLUMN color varchar(10);

-- 添加字段注释
COMMENT ON COLUMN public.calendar_info.color IS '颜色';

-- 可选：设置默认值（根据需要取消注释）
-- UPDATE public.calendar_info SET color = 'default' WHERE color IS NULL;

COMMIT;

-- 验证字段是否成功添加
SELECT column_name, data_type, character_maximum_length, is_nullable 
FROM information_schema.columns 
WHERE table_name = 'calendar_info' 
  AND table_schema = 'public' 
  AND column_name = 'color';

