feat: add indexes to speed some sql queries

This commit is contained in:
Valentin Kaelin 2023-09-25 01:27:29 +02:00
parent 388c14e5ac
commit e0dfeeb0fc
No known key found for this signature in database
GPG key ID: B389A4E3DFF8E414

View file

@ -0,0 +1,16 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class extends BaseSchema {
public async up() {
this.schema.alterTable('matches', (table) => {
table.index(['id', 'gamemode'], 'matches_combined_index1')
})
this.schema.alterTable('match_players', (table) => {
table.index(['summoner_puuid', 'remake', 'match_id'], 'match_players_combined_index1')
table.index(['match_id', 'team', 'summoner_puuid'], 'match_players_combined_index2')
})
}
public async down() {}
}