1584137383826_modify_date_steward_schema.js

25 lines | 565 B Blame History Raw Download
'use strict'

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

class ModifyDateStewardSchema extends Schema {
  up () {
    this.alter('stewards', (table) => {
      // alter table
      table.date('start_date').nullable().alter()
      table.date('end_date').nullable().alter()
    })
  }

  down () {
    this.alter('stewards', (table) => {
      // reverse alternations
      table.date('start_date').notNullable().alter()
      table.date('end_date').notNullable().alter()
    })
  }
}

module.exports = ModifyDateStewardSchema