text: 'use strict'
  
  const Schema = use('Schema')
  
  class ArticleSchema extends Schema {
    up () {
      this.create('articles', (table) => {
        table.increments()
        table.string('title', 60).notNullable().unique()
        table.string('slug', 60).nullable()
        table.text('content')
        //Llaves foraneas
        table.integer('user_id').unsigned().references('id').inTable('users')
        table.integer('category_id').unsigned().references('id').inTable('categories').onDelete('CASCADE').onUpdate('CASCADE')
        table.timestamps()
      })
    }
  
    down () {
      this.drop('articles')
    }
  }
  
  module.exports = ArticleSchema
  