-- 为templates表添加preview_url字段
ALTER TABLE templates 
ADD COLUMN preview_url VARCHAR(500) NULL COMMENT '预览URL' AFTER is_deleted;

-- 更新现有记录的preview_url字段（可选）
-- UPDATE templates SET preview_url = CONCAT('https://view.officeapps.live.com/op/embed.aspx?src=', 
--   (SELECT CONCAT('https://minio.example.com/d8dai/', f.path) 
--    FROM file f WHERE f.id = templates.file_id))
-- WHERE preview_url IS NULL;