Add migration: remove outdated user email index from db

This commit is contained in:
allegroai 2021-01-05 18:55:10 +02:00
parent 641ed1b510
commit e6c0f1b6d8

View File

@ -0,0 +1,12 @@
from collections import Collection
from pymongo.database import Database, Collection
def migrate_auth(db: Database):
"""
Remove the old indices from the user collections
to enable building of the updated user email index
"""
collection: Collection = db["user"]
collection.drop_indexes()