<filename>server/database/migrations/1625392034822_orders_schema.js
'use strict'

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

class OrdersSchema extends Schema {
  up () {
    this.create('orders', (table) => {
      table.increments()
      table.integer('user_id').unsigned().references('id').inTable('users')
      table.integer('store_id').unsigned().references('id').inTable('users')
      table.float('sub_total')
      table.integer('status_id')
      table.datetime('deleted_at')
      table.timestamps()
    })
  }

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

module.exports = OrdersSchema
