mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
feat: add indexes to speed some sql queries
This commit is contained in:
parent
388c14e5ac
commit
e0dfeeb0fc
1 changed files with 16 additions and 0 deletions
16
server/database/migrations/1695597807759_update_indexes.ts
Normal file
16
server/database/migrations/1695597807759_update_indexes.ts
Normal 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() {}
|
||||
}
|
||||
Loading…
Reference in a new issue