Files
life-echo/api/migrations/add_chapter_is_active.sql
penghanyuan 39736a2ae2 feat: 添加章节管理功能以支持清除回忆
- 在数据库模型中新增 is_active 字段,用于标记章节是否启用。
- 添加数据库迁移脚本以更新现有章节,确保默认值为 TRUE。
- 更新章节相关的 API 以仅返回 active 章节,并实现清除章节的功能。
- 在 Android 客户端中实现清除章节的确认弹窗和相应的 API 调用,提升用户体验。
2026-02-14 10:57:51 +01:00

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;