1575321574938_elements_schema.js

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

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

class ElementsSchema extends Schema {
  up () {
    this.create('elements', (table) => {
      table.increments('id')
      table.string('name').notNullable()
      table.integer('theme_id').notNullable().unsigned().references('id').inTable('themes')
      table.integer('priority').nullable().unsigned()
      table.integer('refresh_rate').nullable()
      table.timestamps()
    })
  }

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

module.exports = ElementsSchema