mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-05 10:29:36 +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',
|
`chunk_size` int NOT NULL COMMENT 'chunk size',
|
||||||
`last_sync` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'last sync time',
|
`last_sync` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'last sync time',
|
||||||
`status` varchar(50) NOT NULL COMMENT 'status TODO,RUNNING,FAILED,FINISHED',
|
`status` varchar(50) NOT NULL COMMENT 'status TODO,RUNNING,FAILED,FINISHED',
|
||||||
`content` LONGTEXT NOT NULL COMMENT 'knowledge content',
|
`content` LONGTEXT NOT NULL COMMENT 'knowledge embedding sync result',
|
||||||
`vector_ids` LONGTEXT NOT NULL COMMENT 'vector_ids',
|
`result` TEXT NULL COMMENT 'knowledge content',
|
||||||
|
`vector_ids` LONGTEXT NULL COMMENT 'vector_ids',
|
||||||
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
|
`gmt_created` TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'created time',
|
||||||
`gmt_modified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
|
`gmt_modified` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'update time',
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
|
@ -118,11 +118,11 @@ class KnowledgeDocumentDao:
|
|||||||
count = knowledge_documents.scalar()
|
count = knowledge_documents.scalar()
|
||||||
return count
|
return count
|
||||||
|
|
||||||
# def update_knowledge_document(self, document: KnowledgeDocumentEntity):
|
def update_knowledge_document(self, document: KnowledgeDocumentEntity):
|
||||||
# session = self.Session()
|
session = self.Session()
|
||||||
# updated_space = session.merge(document)
|
updated_space = session.merge(document)
|
||||||
# session.commit()
|
session.commit()
|
||||||
# return updated_space.id
|
return updated_space.id
|
||||||
#
|
#
|
||||||
# def delete_knowledge_document(self, document_id: int):
|
# def delete_knowledge_document(self, document_id: int):
|
||||||
# cursor = self.conn.cursor()
|
# cursor = self.conn.cursor()
|
||||||
|
@ -76,6 +76,7 @@ class KnowledgeService:
|
|||||||
status=SyncStatus.TODO.name,
|
status=SyncStatus.TODO.name,
|
||||||
last_sync=datetime.now(),
|
last_sync=datetime.now(),
|
||||||
content=request.content,
|
content=request.content,
|
||||||
|
result="",
|
||||||
)
|
)
|
||||||
knowledge_document_dao.create_knowledge_document(document)
|
knowledge_document_dao.create_knowledge_document(document)
|
||||||
return True
|
return True
|
||||||
|
Loading…
Reference in New Issue
Block a user