import { BaseSchema } from '@adonisjs/lucid/schema' /** * One row per minute with the averaged host metrics. */ export default class extends BaseSchema { protected tableName = 'metrics' async up() { this.schema.createTable(this.tableName, (table) => { table.increments('id') table.integer('ts').notNullable().index() table.float('cpu').notNullable() table.float('load1').nullable() table.bigInteger('mem_used').notNullable() table.bigInteger('mem_total').notNullable() table.bigInteger('disk_used').notNullable() table.bigInteger('disk_total').notNullable() table.float('net_rx').nullable() table.float('net_tx').nullable() }) } async down() { this.schema.dropTable(this.tableName) } }