From 5e0b1025e381834edd9a4973331f4a3c23c14707 Mon Sep 17 00:00:00 2001 From: isabella Date: Tue, 19 Nov 2024 12:18:42 +0100 Subject: [PATCH] create weaviate migration --- app/vector_database/lecture_schema.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/app/vector_database/lecture_schema.py b/app/vector_database/lecture_schema.py index e82b178c..e90208ed 100644 --- a/app/vector_database/lecture_schema.py +++ b/app/vector_database/lecture_schema.py @@ -31,15 +31,15 @@ def init_lecture_schema(client: WeaviateClient) -> Collection: """ if client.collections.exists(LectureSchema.COLLECTION_NAME.value): collection = client.collections.get(LectureSchema.COLLECTION_NAME.value) - - # collection.config.add_property( - # Property( - # name=LectureSchema.COURSE_LANGUAGE.value, - # description="The language of the COURSE", - # data_type=DataType.TEXT, - # index_searchable=False, - # ) - # ) + if not any((property.name == "course_language") for property in collection.config.get(simple=False).properties): + collection.config.add_property( + Property( + name=LectureSchema.COURSE_LANGUAGE.value, + description="The language of the COURSE", + data_type=DataType.TEXT, + index_searchable=False, + ) + ) return collection