2021-09-16 20:29:20 +00:00
|
|
|
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
|
|
|
|
|
|
|
|
|
|
export default class MatchPlayerRanks extends BaseSchema {
|
|
|
|
|
protected tableName = 'match_player_ranks'
|
|
|
|
|
|
|
|
|
|
public async up() {
|
|
|
|
|
this.schema.createTable(this.tableName, (table) => {
|
|
|
|
|
table.increments('id')
|
|
|
|
|
|
2021-09-19 15:47:07 +00:00
|
|
|
table.integer('player_id').unsigned().notNullable().index()
|
2021-09-16 20:29:20 +00:00
|
|
|
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('gamemode', 'smallint').notNullable()
|
|
|
|
|
|
2021-09-16 20:29:20 +00:00
|
|
|
table.string('tier', 11).notNullable()
|
2021-09-19 15:06:35 +00:00
|
|
|
table.specificType('rank', 'smallint').notNullable()
|
|
|
|
|
table.specificType('lp', 'smallint').unsigned().notNullable()
|
|
|
|
|
table.specificType('wins', 'smallint').unsigned().notNullable()
|
|
|
|
|
table.specificType('losses', 'smallint').unsigned().notNullable()
|
2021-09-16 20:29:20 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Uses timestamptz for PostgreSQL and DATETIME2 for MSSQL
|
|
|
|
|
*/
|
|
|
|
|
table.timestamp('created_at', { useTz: true })
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public async down() {
|
|
|
|
|
this.schema.dropTable(this.tableName)
|
|
|
|
|
}
|
|
|
|
|
}
|