1575321574938_elements_schema.js

23 lines | 537 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()
    })
  }

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

module.exports = ElementsSchema