diff --git a/apiserver/mongo/migrations/0.13.0.py b/apiserver/mongo/migrations/0.13.0.py index ce714e2..c9a1d1a 100644 --- a/apiserver/mongo/migrations/0.13.0.py +++ b/apiserver/mongo/migrations/0.13.0.py @@ -5,8 +5,7 @@ from pymongo.database import Database, Collection def migrate_auth(db: Database): collection: Collection = db["user"] - if "name_1_company_1" in [doc["name"] for doc in collection.list_indexes()]: - collection.drop_index("name_1_company_1") + collection.drop_indexes() def migrate_backend(db: Database): diff --git a/apiserver/mongo/migrations/0.14.0.py b/apiserver/mongo/migrations/0.14.0.py index c8be217..c83cb4b 100644 --- a/apiserver/mongo/migrations/0.14.0.py +++ b/apiserver/mongo/migrations/0.14.0.py @@ -31,8 +31,8 @@ def migrate_auth(db: Database): if not uuids: return - collection = db["user"] - collection.drop_index("name_1_company_1") + collection: Collection = db["user"] + collection.drop_indexes() _switch_uuid(collection=collection, uuid_field="_id", uuids=uuids)