2
0
mirror of https://github.com/thedevs-network/the-guard-bot synced 2025-08-31 06:05:22 +00:00

fix: rm unique index on username

Users can delete their account or rename their username and it's is released for anyone to pick up

Signed-off-by: Muthu Kumar <muthukumar@thefeathers.in>
This commit is contained in:
Muthu Kumar
2022-02-16 01:04:01 +05:30
parent a14f9d0c97
commit 117c0c7f59

View File

@@ -33,7 +33,7 @@ User.update(
{ $unset: { username: true } },
{ multi: true },
).then(() =>
User.ensureIndex({ fieldName: 'username', sparse: true, unique: true }));
User.ensureIndex({ fieldName: 'username', sparse: true }));
const normalizeTgUser = R.pipe(
R.pick([ 'first_name', 'id', 'last_name', 'username' ]),