text: 'use strict'
  
  /** @type {import('@adonisjs/lucid/src/Schema')} */
  const Schema = use('Schema')
  
  class NotificationSchema extends Schema {
    up () {
      this.create('notifications', (table) => {
        table.increments()
        table.string('title').notNull()
        table.string('description').notNull()
        table.integer('invite_id')
          .unsigned()
          .references('id')
          .inTable('invites')
          .onDelete('CASCADE')
          .onUpdate('CASCADE')
        table.integer('user_id')
          .unsigned()
          .references('id')
          .inTable('users')
          .onDelete('CASCADE')
          .onUpdate('CASCADE')
        table.integer('author_id')
          .unsigned()
          .references('id')
          .inTable('users')
          .onDelete('CASCADE')
          .onUpdate('CASCADE')
        table.boolean('viewed').defaultTo(false)
        table.string('links_to')
        table.timestamps()
      })
    }
  
    down () {
      this.drop('notifications')
    }
  }
  
  module.exports = NotificationSchema
  