diff --git a/src/api/models/user.ts b/src/api/models/user.ts index 63f79908e3..46d32963bc 100644 --- a/src/api/models/user.ts +++ b/src/api/models/user.ts @@ -59,6 +59,7 @@ export type IUser = { is_suspended: boolean; keywords: string[]; host: string; + host_lower: string; account: { keypair: string; email: string; diff --git a/src/api/private/signup.ts b/src/api/private/signup.ts index a4c06b5f5e..280153d4f5 100644 --- a/src/api/private/signup.ts +++ b/src/api/private/signup.ts @@ -120,6 +120,7 @@ export default async (req: express.Request, res: express.Response) => { username: username, username_lower: username.toLowerCase(), host: null, + host_lower: null, account: { keypair: generateKeypair(), token: secret, diff --git a/tools/migration/shell.1522116710.user-host_lower.js b/tools/migration/shell.1522116710.user-host_lower.js new file mode 100644 index 0000000000..31ec6c468a --- /dev/null +++ b/tools/migration/shell.1522116710.user-host_lower.js @@ -0,0 +1 @@ +db.users.update({ }, { $set: { host_lower: null } }, { multi: true });