1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-11-30 07:48:13 +09:00

Add some indexes

This commit is contained in:
syuilo 2018-04-14 14:42:18 +09:00
parent 7cec7fb103
commit 08531e8002

View File

@ -22,6 +22,8 @@ import SwSubscription, { deleteSwSubscription } from './sw-subscription';
const User = db.get<IUser>('users'); const User = db.get<IUser>('users');
User.createIndex('username');
User.createIndex('usernameLower');
User.createIndex(['username', 'host'], { unique: true }); User.createIndex(['username', 'host'], { unique: true });
User.createIndex(['usernameLower', 'host'], { unique: true }); User.createIndex(['usernameLower', 'host'], { unique: true });
User.createIndex('token', { unique: true }); User.createIndex('token', { unique: true });