2021-09-12 13:16:08 +00:00
|
|
|
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
|
|
|
|
|
|
|
|
export default class MatchPlayers extends BaseSchema {
|
|
|
|
|
protected tableName = 'match_players'
|
|
|
|
|
|
|
|
|
|
public async up() {
|
|
|
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
|
|
|
table.increments('id')
|
2021-09-19 15:47:07 +00:00
|
|
|
table.string('match_id', 15).notNullable().index()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('participant_id', 'smallint').notNullable()
|
2021-09-13 20:06:12 +00:00
|
|
|
table.string('summoner_id', 63).notNullable()
|
2021-09-19 15:47:07 +00:00
|
|
|
table.string('summoner_puuid', 78).notNullable().index()
|
2021-09-12 13:16:08 +00:00
|
|
|
table.string('summoner_name', 16).notNullable()
|
|
|
|
|
|
2021-09-16 11:49:32 +00:00
|
|
|
table.specificType('win', 'smallint').notNullable()
|
|
|
|
|
table.specificType('loss', 'smallint').notNullable()
|
|
|
|
|
table.specificType('remake', 'smallint').notNullable()
|
|
|
|
|
|
2021-09-19 15:47:07 +00:00
|
|
|
table.specificType('team', 'smallint').notNullable().index()
|
|
|
|
|
table.specificType('team_position', 'smallint').notNullable().index()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('kills', 'smallint').unsigned().notNullable()
|
|
|
|
|
table.specificType('deaths', 'smallint').unsigned().notNullable()
|
|
|
|
|
table.specificType('assists', 'smallint').unsigned().notNullable()
|
2021-09-12 14:09:29 +00:00
|
|
|
table.float('kda').notNullable()
|
|
|
|
|
table.float('kp').notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('champ_level', 'smallint').notNullable()
|
2021-09-19 15:47:07 +00:00
|
|
|
table.specificType('champion_id', 'smallint').notNullable().index()
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('champion_role', 'smallint').notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('double_kills', 'smallint').notNullable()
|
|
|
|
|
table.specificType('triple_kills', 'smallint').notNullable()
|
|
|
|
|
table.specificType('quadra_kills', 'smallint').notNullable()
|
|
|
|
|
table.specificType('penta_kills', 'smallint').notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('baron_kills', 'smallint').notNullable()
|
|
|
|
|
table.specificType('dragon_kills', 'smallint').notNullable()
|
|
|
|
|
table.specificType('turret_kills', 'smallint').notNullable()
|
|
|
|
|
table.specificType('vision_score', 'smallint').notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
table.integer('gold').notNullable()
|
|
|
|
|
|
2021-09-19 15:10:49 +00:00
|
|
|
table.integer('summoner1_id').notNullable()
|
|
|
|
|
table.integer('summoner2_id').notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
|
|
|
|
table.integer('item0').notNullable()
|
|
|
|
|
table.integer('item1').notNullable()
|
|
|
|
|
table.integer('item2').notNullable()
|
|
|
|
|
table.integer('item3').notNullable()
|
|
|
|
|
table.integer('item4').notNullable()
|
|
|
|
|
table.integer('item5').notNullable()
|
|
|
|
|
table.integer('item6').notNullable()
|
|
|
|
|
|
|
|
|
|
table.integer('damage_dealt_objectives').notNullable()
|
2021-09-12 14:09:29 +00:00
|
|
|
table.integer('damage_dealt_champions').notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
table.integer('damage_taken').notNullable()
|
|
|
|
|
table.integer('heal').notNullable()
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('minions', 'smallint').notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('critical_strike', 'smallint').unsigned().notNullable()
|
|
|
|
|
table.specificType('killing_spree', 'smallint').unsigned().notNullable()
|
|
|
|
|
table.specificType('time_spent_living', 'smallint').unsigned().notNullable()
|
2021-09-12 13:16:08 +00:00
|
|
|
|
|
|
|
|
table.integer('perks_primary_style').notNullable()
|
|
|
|
|
table.integer('perks_secondary_style').notNullable()
|
|
|
|
|
table.specificType('perks_selected', 'INT[]').notNullable()
|
|
|
|
|
})
|
2021-09-19 15:47:07 +00:00
|
|
|
|
|
|
|
|
this.schema.alterTable(this.tableName, (table) => {
|
|
|
|
|
table.unique(['match_id', 'summoner_puuid'])
|
|
|
|
|
})
|
2021-09-12 13:16:08 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down() {
|
|
|
|
|
this.schema.dropTable(this.tableName)
|
|
|
|
|
}
|
|
|
|
|
}
|