- models/file.go:File 模型,字段与 Attachment 对齐并新增 Type 归属类型字段 - models/db.go:AutoMigrate 注册 File;启动时幂等迁移 attachments → files (按主键 id 对齐跳过已迁移行,含软删除行一并复制) - scripts/add_files_table.sql:MariaDB 幂等迁移脚本(建表 + INSERT...SELECT) - 线上库 blog_go:files 表已建立,15 条 attachments 记录已迁入,type='attachments'