|
|
@ -43,17 +43,17 @@ export class Database { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async insertTestData() { |
|
|
|
async insertTestData() { |
|
|
|
const NUM = 100; |
|
|
|
const NUM = 50; |
|
|
|
const users: User[] = []; |
|
|
|
const users: User[] = []; |
|
|
|
for (let i = 0; i < NUM; i++) { |
|
|
|
for (let i = 0; i < NUM; i++) { |
|
|
|
const username = "alex" + i % 50; |
|
|
|
const username = "alex" + i; |
|
|
|
let user = await this.users.findByUsername(username); |
|
|
|
let user = await this.users.findByUsername(username); |
|
|
|
// if (!user) {
|
|
|
|
if (!user) { |
|
|
|
user = await this.users.create({ |
|
|
|
user = await this.users.create({ |
|
|
|
name: "Alex Mikhalev" + i, |
|
|
|
name: "Alex Mikhalev" + i, |
|
|
|
username |
|
|
|
username |
|
|
|
}); |
|
|
|
}); |
|
|
|
// }
|
|
|
|
} |
|
|
|
await user.setPassword("kakashka" + i); |
|
|
|
await user.setPassword("kakashka" + i); |
|
|
|
users.push(user); |
|
|
|
users.push(user); |
|
|
|
} |
|
|
|
} |
|
|
|