Skip to content

Commit 9dacee9

Browse files
committed
Fix dropping atlas index when atlas is unsuported
1 parent dd1c77a commit 9dacee9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

django_mongodb_backend/schema.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ def remove_index(self, model, index):
293293
if index.contains_expressions:
294294
return
295295
if isinstance(index, SearchIndex | VectorSearchIndex):
296-
self.get_collection(model._meta.db_table).drop_search_index(index.name)
296+
if self.connection.features.supports_atlas_search:
297+
self.get_collection(model._meta.db_table).drop_search_index(index.name)
297298
else:
298299
self.get_collection(model._meta.db_table).drop_index(index.name)
299300

0 commit comments

Comments
 (0)