1575322970641_contact_notes_schema.js

22 lines | 484 B Blame History Raw Download
'use strict'

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

class ContactNotesSchema extends Schema {
  up () {
    this.create('contact_notes', (table) => {
      table.increments('id')
      table.integer('contact_id').notNullable().unsigned().references('id').inTable('contacts')
      table.text('content').notNullable()
      table.timestamps()
    })
  }

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

module.exports = ContactNotesSchema