1575323309230_stewards_schema.js

23 lines | 495 B Blame History Raw Download
'use strict'

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

class StewardsSchema extends Schema {
  up () {
    this.create('stewards', (table) => {
      table.increments('id')
      table.integer('contact_id').notNullable().references('id').inTable('contacts')
      table.date('start_date').nullable()
      table.date('end_date').nullable()
      table.timestamps()
    })
  }

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

module.exports = StewardsSchema