aboutsummaryrefslogtreecommitdiffstats
path: root/database/migrations/1566554231482_recipe_schema.js
blob: 7d8f5a875fde494b7f342d2cff5327e6b410f5a1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
'use strict'

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

class RecipeSchema extends Schema {
  up () {
    this.create('recipes', (table) => {
      table.increments()
      table.string('name', 80).notNullable()
      table.string('recipeId', 254).notNullable().unique()
      table.json('data')
      table.timestamps()
    })
  }

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

module.exports = RecipeSchema