feat(数据库): 添加对话标签系统字段

- 在 conversations 表中添加 tags 字段(jsonb 类型数组)
- 添加 autoTaggedAt 字段记录 AI 自动标签生成时间
- 生成数据库迁移文件
This commit is contained in:
gaoziman 2025-12-28 17:27:09 +08:00
parent 039a9b6b49
commit a50ab2c8ee
4 changed files with 1366 additions and 0 deletions

View File

@ -0,0 +1,2 @@
ALTER TABLE "conversations" ADD COLUMN "tags" jsonb DEFAULT '[]'::jsonb;--> statement-breakpoint
ALTER TABLE "conversations" ADD COLUMN "auto_tagged_at" timestamp with time zone;

File diff suppressed because it is too large Load Diff

View File

@ -113,6 +113,13 @@
"when": 1766812096044,
"tag": "0015_milky_anthem",
"breakpoints": true
},
{
"idx": 16,
"version": "7",
"when": 1766857466874,
"tag": "0016_next_ultimo",
"breakpoints": true
}
]
}

View File

@ -173,6 +173,9 @@ export const conversations = pgTable('conversations', {
// 状态
isArchived: boolean('is_archived').default(false),
isPinned: boolean('is_pinned').default(false),
// 标签系统
tags: jsonb('tags').$type<string[]>().default([]), // 对话标签数组
autoTaggedAt: timestamp('auto_tagged_at', { withTimezone: true }), // AI 自动标签生成时间
// 时间戳
createdAt: timestamp('created_at', { withTimezone: true }).defaultNow(),
updatedAt: timestamp('updated_at', { withTimezone: true }).defaultNow(),