feat: add migrations to create indexes

This commit is contained in:
Valentin Kaelin 2020-10-04 16:04:42 +02:00
parent bd3bd7c445
commit 143ab1b4be
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,9 @@
import BaseMigration from '@ioc:Mongodb/Migration'
export default class MatchMigration extends BaseMigration {
public up (): void {
// this.createCollection('matches')
this.createIndex('matches', 'gameId')
this.createIndex('matches', 'summoner_puuid')
}
}

View file

@ -0,0 +1,8 @@
import BaseMigration from '@ioc:Mongodb/Migration'
export default class SummonerMigration extends BaseMigration {
public up (): void {
// this.createCollection('summoners')
this.createIndex('summoners', 'puuid')
}
}

View file

@ -0,0 +1,8 @@
import BaseMigration from '@ioc:Mongodb/Migration'
export default class DetailedMatchMigration extends BaseMigration {
public up (): void {
// this.createCollection('detailed_matches')
this.createIndex('detailed_matches', 'gameId')
}
}