feat: add towers field to match_teams table

This commit is contained in:
Kalane 2021-09-16 16:01:21 +02:00
parent ed79b4cd7c
commit 2f677ab17b
3 changed files with 5 additions and 0 deletions

View file

@ -29,6 +29,9 @@ export default class MatchTeam extends BaseModel {
@column() @column()
public riftHeralds: number public riftHeralds: number
@column()
public towers: number
@column() @column()
public bans?: number[] public bans?: number[]

View file

@ -36,6 +36,7 @@ class MatchParser {
dragons: team.objectives.dragon.kills, dragons: team.objectives.dragon.kills,
inhibitors: team.objectives.inhibitor.kills, inhibitors: team.objectives.inhibitor.kills,
riftHeralds: team.objectives.riftHerald.kills, riftHeralds: team.objectives.riftHerald.kills,
towers: team.objectives.tower.kills,
bans: team.bans.length ? team.bans.map((ban) => ban.championId) : undefined, bans: team.bans.length ? team.bans.map((ban) => ban.championId) : undefined,
banOrders: team.bans.length ? team.bans.map((ban) => ban.pickTurn) : undefined, banOrders: team.bans.length ? team.bans.map((ban) => ban.pickTurn) : undefined,
}) })

View file

@ -15,6 +15,7 @@ export default class MatchTeams extends BaseSchema {
table.integer('dragons').notNullable() table.integer('dragons').notNullable()
table.integer('inhibitors').notNullable() table.integer('inhibitors').notNullable()
table.integer('rift_heralds').notNullable() table.integer('rift_heralds').notNullable()
table.integer('towers').notNullable()
table.specificType('bans', 'INT[]').nullable() table.specificType('bans', 'INT[]').nullable()
table.specificType('ban_orders', 'INT[]').nullable() table.specificType('ban_orders', 'INT[]').nullable()