mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-07-30 15:21:02 +00:00
fix:update knowledge schema sql
update knowledge schema sql
This commit is contained in:
parent
5951215c0b
commit
b2f1b1319f
@ -18,8 +18,9 @@ CREATE TABLE `knowledge_document` (
|
||||
`chunk_size` int NOT NULL COMMENT 'chunk size',
|
||||
`last_sync` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'last sync time',
|
||||
`status` varchar(50) NOT NULL COMMENT 'status TODO,RUNNING,FAILED,FINISHED',
|
||||
`content` LONGTEXT NOT NULL COMMENT 'knowledge content',
|
||||
`vector_ids` LONGTEXT NOT NULL COMMENT 'vector_ids',
|
||||
`content` LONGTEXT NOT NULL COMMENT 'knowledge embedding sync result',
|
||||
`result` TEXT NULL COMMENT 'knowledge content',
|
||||
`vector_ids` LONGTEXT NULL COMMENT 'vector_ids',
|
||||
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
|
||||
`gmt_modified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
|
||||
PRIMARY KEY (`id`),
|
||||
|
@ -118,11 +118,11 @@ class KnowledgeDocumentDao:
|
||||
count = knowledge_documents.scalar()
|
||||
return count
|
||||
|
||||
# def update_knowledge_document(self, document: KnowledgeDocumentEntity):
|
||||
# session = self.Session()
|
||||
# updated_space = session.merge(document)
|
||||
# session.commit()
|
||||
# return updated_space.id
|
||||
def update_knowledge_document(self, document: KnowledgeDocumentEntity):
|
||||
session = self.Session()
|
||||
updated_space = session.merge(document)
|
||||
session.commit()
|
||||
return updated_space.id
|
||||
#
|
||||
# def delete_knowledge_document(self, document_id: int):
|
||||
# cursor = self.conn.cursor()
|
||||
|
@ -76,6 +76,7 @@ class KnowledgeService:
|
||||
status=SyncStatus.TODO.name,
|
||||
last_sync=datetime.now(),
|
||||
content=request.content,
|
||||
result="",
|
||||
)
|
||||
knowledge_document_dao.create_knowledge_document(document)
|
||||
return True
|
||||
|
Loading…
Reference in New Issue
Block a user