imetting_backend/sql/migrations/add_prompt_id_to_main_table...

34 lines
1.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

-- ============================================
-- 添加 prompt_id 字段到主表
-- 创建时间: 2025-01-11
-- 说明: 在 meetings 和 knowledge_bases 表中添加 prompt_id 字段
-- 用于记录会议/知识库使用的提示词模版
-- ============================================
-- 1. 为 meetings 表添加 prompt_id 字段
ALTER TABLE meetings
ADD COLUMN prompt_id INT(11) DEFAULT 0 COMMENT '使用的提示词模版ID0表示未使用或使用默认模版'
AFTER summary;
-- 为 meetings 表添加索引
ALTER TABLE meetings
ADD INDEX idx_prompt_id (prompt_id);
-- 2. 为 knowledge_bases 表添加 prompt_id 字段
ALTER TABLE knowledge_bases
ADD COLUMN prompt_id INT(11) DEFAULT 0 COMMENT '使用的提示词模版ID0表示未使用或使用默认模版'
AFTER tags;
-- 为 knowledge_bases 表添加索引
ALTER TABLE knowledge_bases
ADD INDEX idx_prompt_id (prompt_id);
-- ============================================
-- 验证修改
-- ============================================
-- 查看 meetings 表结构
-- DESCRIBE meetings;
-- 查看 knowledge_bases 表结构
-- DESCRIBE knowledge_bases;