refactor(db): 删除旧分区展示块与兼容字段

- v23 迁移删除 section_block 表,以及 node 的 view_mode / empty_text / show_in_sidebar / allow_groups
- 重建 node 表并保留 44 条内容、15 个分组、5 张卡片,外键检查通过
- 种子库直接生成 card / card_group,不再依赖 section_block
- 删除旧 /api/catalog、/api/categories、/api/groups/{id} 与 categories 模块
- 分组接口不再接收/返回 format,前端 GroupNode 同步移除
- README/HANDOFF 更新到 v23;管理页提示改为『格式由每条内容决定』
This commit is contained in:
2026-11-02 20:24:08 +08:00
parent 4621f8cb22
commit 27e411fd2c
10 changed files with 213 additions and 1652 deletions
+1 -3
View File
@@ -19,7 +19,6 @@ export type GroupNode = {
key: string
parentKey?: string | null
title: string
format: GroupFormat
icon: string
barColor: string
previewLimit?: number | null
@@ -189,13 +188,12 @@ export async function setCardGroups(
export function flattenGroups(
groups: GroupNode[],
depth = 0,
): { key: string; title: string; depth: number; format: GroupFormat; enabled: boolean }[] {
): { key: string; title: string; depth: number; enabled: boolean }[] {
return groups.flatMap((group) => [
{
key: group.key,
title: group.title,
depth,
format: group.format,
enabled: group.enabled !== false,
},
...flattenGroups(group.children, depth + 1),