LeagueStats/server-v2/database/migrations/1631397498477_match_teams.ts

28 lines
784 B
TypeScript
Raw Normal View History

2021-09-12 13:16:08 +00:00
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class MatchTeams extends BaseSchema {
protected tableName = 'match_teams'
public async up() {
this.schema.createTable(this.tableName, (table) => {
table.increments('id')
2021-09-12 14:09:29 +00:00
table.string('match_id', 15)
2021-09-12 13:16:08 +00:00
table.integer('color').notNullable() // 100 ou 200
table.string('result', 6) // Win - Remake - Fail
2021-09-12 14:09:29 +00:00
table.integer('barons').notNullable()
2021-09-12 13:16:08 +00:00
table.integer('dragons').notNullable()
table.integer('inhibitors').notNullable()
table.integer('rift_heralds').notNullable()
table.specificType('bans', 'INT[]').nullable()
table.specificType('ban_orders', 'INT[]').nullable()
2021-09-12 13:16:08 +00:00
})
}
public async down() {
this.schema.dropTable(this.tableName)
}
}