From 143ab1b4bea961377d55f8601a3cf0156937bd16 Mon Sep 17 00:00:00 2001 From: Valentin Kaelin Date: Sun, 4 Oct 2020 16:04:42 +0200 Subject: [PATCH] feat: add migrations to create indexes --- server-new/mongodb/migrations/1601816721286_match.ts | 9 +++++++++ server-new/mongodb/migrations/1601819828861_summoner.ts | 8 ++++++++ .../mongodb/migrations/1601819837856_detailed_match.ts | 8 ++++++++ 3 files changed, 25 insertions(+) create mode 100644 server-new/mongodb/migrations/1601816721286_match.ts create mode 100644 server-new/mongodb/migrations/1601819828861_summoner.ts create mode 100644 server-new/mongodb/migrations/1601819837856_detailed_match.ts diff --git a/server-new/mongodb/migrations/1601816721286_match.ts b/server-new/mongodb/migrations/1601816721286_match.ts new file mode 100644 index 0000000..1187d86 --- /dev/null +++ b/server-new/mongodb/migrations/1601816721286_match.ts @@ -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') + } +} diff --git a/server-new/mongodb/migrations/1601819828861_summoner.ts b/server-new/mongodb/migrations/1601819828861_summoner.ts new file mode 100644 index 0000000..87045a4 --- /dev/null +++ b/server-new/mongodb/migrations/1601819828861_summoner.ts @@ -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') + } +} diff --git a/server-new/mongodb/migrations/1601819837856_detailed_match.ts b/server-new/mongodb/migrations/1601819837856_detailed_match.ts new file mode 100644 index 0000000..4c86664 --- /dev/null +++ b/server-new/mongodb/migrations/1601819837856_detailed_match.ts @@ -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') + } +}