fix: 修正迁移脚本中的表名拼写错误

This commit is contained in:
wizardchen
2026-01-15 14:33:43 +08:00
parent 3f25d36c46
commit 879e582041
5 changed files with 2 additions and 215 deletions
@@ -1,5 +0,0 @@
-- Migration 000010: Remove seq_id from chunks and knowledge_tags tables
-- MySQL version
ALTER TABLE chunks DROP COLUMN seq_id;
ALTER TABLE knowledge_tags DROP COLUMN seq_id;
-29
View File
@@ -1,29 +0,0 @@
-- Migration 000010: Add seq_id (auto-increment integer ID) to chunks and knowledge_tags tables
-- This provides integer IDs for FAQ entries and tags for external API usage
-- MySQL version
-- ============================================================================
-- Section 1: Add seq_id to chunks table
-- ============================================================================
-- Add seq_id column with AUTO_INCREMENT (historical data starts from 1)
ALTER TABLE chunks ADD COLUMN seq_id BIGINT NOT NULL AUTO_INCREMENT UNIQUE KEY;
-- Update historical data to start from 100000000
UPDATE chunks SET seq_id = seq_id + 99999999;
-- Set AUTO_INCREMENT for future inserts (must be greater than max seq_id)
ALTER TABLE chunks AUTO_INCREMENT = 200000000;
-- ============================================================================
-- Section 2: Add seq_id to knowledge_tags table
-- ============================================================================
-- Add seq_id column with AUTO_INCREMENT (historical data starts from 1)
ALTER TABLE knowledge_tags ADD COLUMN seq_id BIGINT NOT NULL AUTO_INCREMENT UNIQUE KEY;
-- Update historical data to start from 10000000
UPDATE knowledge_tags SET seq_id = seq_id + 9999999;
-- Set AUTO_INCREMENT for future inserts (must be greater than max seq_id)
ALTER TABLE knowledge_tags AUTO_INCREMENT = 20000000;
@@ -1,3 +1,3 @@
-- Remove last_faq_import_result column from knowledge table
ALTER TABLE knowledge DROP COLUMN last_faq_import_result;
ALTER TABLE knowledges DROP COLUMN last_faq_import_result;
@@ -1,4 +1,4 @@
-- Add last_faq_import_result column to knowledge table
-- This field stores the latest FAQ import result for FAQ type knowledge
ALTER TABLE knowledge ADD COLUMN last_faq_import_result JSON DEFAULT NULL COMMENT 'Last FAQ import result (for FAQ type knowledge only)';
ALTER TABLE knowledges ADD COLUMN last_faq_import_result JSON DEFAULT NULL;