1575323184990_funding_schema.js

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

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

class FundingSchema extends Schema {
  up () {
    this.create('fundings', (table) => {
      table.increments('id')
      table.float('amount', 2).notNullable()
      table.string('document').notNullable()
      table.date('date_awarded').notNullable()
      table.integer('element_id').notNullable().references('id').inTable('elements')
      table.timestamps()
    })
  }

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

module.exports = FundingSchema