Files
msh-system/docs/sql/v2_recipes_add_source.sql

16 lines
654 B
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- =============================================
-- v2_recipes 表新增 source 相关字段
-- 用于追踪食谱来源(手动/计算器/AI生成等
-- Author: ScottPan
-- Date: 2026-02-14
-- =============================================
ALTER TABLE v2_recipes
ADD COLUMN `source` VARCHAR(20) DEFAULT 'manual' COMMENT '来源manual(手动)/calculator(计算器)/ai(AI生成)' AFTER `sort_order`,
ADD COLUMN `source_id` BIGINT DEFAULT NULL COMMENT '来源ID如计算器结果ID' AFTER `source`;
-- 新增索引,便于按来源查询
ALTER TABLE v2_recipes
ADD KEY `idx_source` (`source`),
ADD KEY `idx_source_id` (`source_id`);