Feat/vdb migrate command (#2562)

Co-authored-by: jyong <jyong@dify.ai>
This commit is contained in:
Jyong
2024-02-26 19:47:29 +08:00
committed by GitHub
parent d93288f711
commit 0620fa3094
5 changed files with 134 additions and 57 deletions

View File

@@ -127,7 +127,10 @@ class WeaviateVector(BaseVector):
)
def delete(self):
self._client.schema.delete_class(self._collection_name)
# check whether the index already exists
schema = self._default_schema(self._collection_name)
if self._client.schema.contains(schema):
self._client.schema.delete_class(self._collection_name)
def text_exists(self, id: str) -> bool:
collection_name = self._collection_name