fix(schema): sync ORM entities with database schema
- Add missing 'type' column to MessageORM entity - Add 'TEXT_WITH_ATTACHMENTS' to messages.type CHECK constraint (matches MessageType enum in conversation-service) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
fcffaebdc9
commit
0f56cea96a
|
|
@ -16,6 +16,9 @@ export class MessageORM {
|
|||
@Column({ length: 20 })
|
||||
role: string;
|
||||
|
||||
@Column({ length: 30, default: 'TEXT' })
|
||||
type: string;
|
||||
|
||||
@Column('text')
|
||||
content: string;
|
||||
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ CREATE TABLE messages (
|
|||
role VARCHAR(20) NOT NULL CHECK (role IN ('user', 'assistant', 'system')),
|
||||
-- 消息类型
|
||||
type VARCHAR(30) NOT NULL DEFAULT 'TEXT'
|
||||
CHECK (type IN ('TEXT', 'TOOL_CALL', 'TOOL_RESULT', 'PAYMENT_REQUEST', 'ASSESSMENT_START', 'ASSESSMENT_RESULT')),
|
||||
CHECK (type IN ('TEXT', 'TEXT_WITH_ATTACHMENTS', 'TOOL_CALL', 'TOOL_RESULT', 'PAYMENT_REQUEST', 'ASSESSMENT_START', 'ASSESSMENT_RESULT')),
|
||||
-- 消息内容
|
||||
content TEXT NOT NULL,
|
||||
-- 元数据(工具调用信息、Token使用等)
|
||||
|
|
|
|||
Loading…
Reference in New Issue