1575322085612_standards_schema.js

24 lines | 569 B Blame History Raw Download
'use strict'

/** @type {import('@adonisjs/lucid/src/Schema')} */
const Schema = use('Schema')

class StandardsSchema extends Schema {
  up () {
    this.create('standards', (table) => {
      table.increments('id')
      table.integer('element_id').notNullable().unsigned().references('id').inTable('elements')
      table.string('document').notNullable()
      table.float('version', 2).unsigned().notNullable()
      table.date('retired').nullable()
      table.timestamps()
    })
  }

  down () {
    this.drop('standards')
  }
}

module.exports = StandardsSchema