Files
life-echo/api/migrations/add_chapter_is_active.sql

9 lines
360 B
MySQL
Raw Normal View History

-- 为 chapters 表添加 is_active 字段
-- 用于支持"清除回忆"功能:将章节标记为 disabled 而非物理删除
-- 默认值为 TRUE现有章节全部为 active
ALTER TABLE chapters ADD COLUMN IF NOT EXISTS is_active BOOLEAN DEFAULT TRUE;
-- 确保现有数据全部为 active
UPDATE chapters SET is_active = TRUE WHERE is_active IS NULL;