Better indexes
This commit is contained in:
		
							parent
							
								
									9b8769f163
								
							
						
					
					
						commit
						26c979bcec
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -22,9 +22,9 @@ import SwSubscription, { deleteSwSubscription } from './sw-subscription';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const User = db.get<IUser>('users');
 | 
					const User = db.get<IUser>('users');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
User.createIndex('username');
 | 
					User.createIndex(['username', 'host'], { unique: true });
 | 
				
			||||||
User.createIndex('usernameLower');
 | 
					User.createIndex(['usernameLower', 'host'], { unique: true });
 | 
				
			||||||
User.createIndex('token');
 | 
					User.createIndex('token', { unique: true });
 | 
				
			||||||
User.createIndex('uri', { sparse: true, unique: true });
 | 
					User.createIndex('uri', { sparse: true, unique: true });
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export default User;
 | 
					export default User;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue