From d316337e873380f165215e063bb76845037424e2 Mon Sep 17 00:00:00 2001 From: Tnix Date: Tue, 10 Sep 2024 01:22:22 +1200 Subject: [PATCH] add usersv0 indexes for emails --- database.py | 4 ++++ 1 file changed, 4 insertions(+) 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: