feat(数据库): 添加对话标签系统字段
- 在 conversations 表中添加 tags 字段(jsonb 类型数组) - 添加 autoTaggedAt 字段记录 AI 自动标签生成时间 - 生成数据库迁移文件
This commit is contained in:
parent
039a9b6b49
commit
a50ab2c8ee
2
src/drizzle/migrations/0016_next_ultimo.sql
Normal file
2
src/drizzle/migrations/0016_next_ultimo.sql
Normal 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;
|
||||
1354
src/drizzle/migrations/meta/0016_snapshot.json
Normal file
1354
src/drizzle/migrations/meta/0016_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@ -113,6 +113,13 @@
|
||||
"when": 1766812096044,
|
||||
"tag": "0015_milky_anthem",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 16,
|
||||
"version": "7",
|
||||
"when": 1766857466874,
|
||||
"tag": "0016_next_ultimo",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -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(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user