LeagueStats/server-v2/database/migrations/1631392766690_match_players.ts

75 lines
3.1 KiB
TypeScript
Raw Normal View History

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
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()
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
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
table.specificType('champ_level', 'smallint').notNullable()
2021-09-19 15:47:07 +00:00
table.specificType('champion_id', 'smallint').notNullable().index()
table.specificType('champion_role', 'smallint').notNullable()
2021-09-12 13:16:08 +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
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()
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()
table.specificType('minions', 'smallint').notNullable()
2021-09-12 13:16:08 +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()
})
}
public async down() {
this.schema.dropTable(this.tableName)
}
}