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

9 lines
360 B
SQL
Raw 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.
-- 为 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;