LeagueStats/server-v2/database/migrations/1631392754960_matches.ts

27 lines
828 B
TypeScript
Raw Normal View History

2021-09-12 13:16:08 +00:00
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Matches extends BaseSchema {
protected tableName = 'matches'
public async up() {
this.schema.createTable(this.tableName, (table) => {
table.string('id', 15).primary()
table.bigInteger('game_id').notNullable()
table.specificType('map', 'smallint').notNullable()
2021-09-19 15:47:07 +00:00
table.specificType('gamemode', 'smallint').notNullable().index()
table.bigInteger('date').notNullable()
2021-09-12 13:16:08 +00:00
table.string('region', 4).notNullable()
table.specificType('result', 'smallint').notNullable()
2021-09-12 13:16:08 +00:00
2021-09-19 15:47:07 +00:00
table.float('season').notNullable().index()
table.specificType('game_duration', 'smallint').unsigned().notNullable()
2021-09-12 13:16:08 +00:00
})
2021-09-19 15:47:07 +00:00
// this.schema.alterTable
2021-09-12 13:16:08 +00:00
}
public async down() {
this.schema.dropTable(this.tableName)
}
}