diff --git a/database.py b/database.py index cae9e44..e66ba1a 100644 --- a/database.py +++ b/database.py @@ -45,6 +45,10 @@ # Create usersv0 indexes try: db.usersv0.create_index([("lower_username", pymongo.ASCENDING)], name="lower_username", unique=True) except: pass +try: db.usersv0.create_index([("email", pymongo.ASCENDING)], name="email", unique=True) +except: pass +try: db.usersv0.create_index([("normalized_email_hash", pymongo.ASCENDING)], name="normalized_email_hash", unique=True) +except: pass try: db.usersv0.create_index([("created", pymongo.DESCENDING)], name="recent_users") except: pass try: