summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-27 15:57:42 +0900
committerAkihiko Odaki <nekomanma@pixiv.co.jp>2018-03-27 15:57:42 +0900
commit285bf04221723fe1f12fce7707d34ea7f6ecdf1d (patch)
tree07be810b089ecf4ef8fcb74fa4026215c688d24c
parentBye bye secondary domain (diff)
downloadsharkey-285bf04221723fe1f12fce7707d34ea7f6ecdf1d.tar.gz
sharkey-285bf04221723fe1f12fce7707d34ea7f6ecdf1d.tar.bz2
sharkey-285bf04221723fe1f12fce7707d34ea7f6ecdf1d.zip
Add host_lower to User
-rw-r--r--src/api/models/user.ts1
-rw-r--r--src/api/private/signup.ts1
-rw-r--r--tools/migration/shell.1522116710.user-host_lower.js1
3 files changed, 3 insertions, 0 deletions
diff --git a/src/api/models/user.ts b/src/api/models/user.ts
index 08d7fbb8c7..a3ffbd1f71 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 });