aboutsummaryrefslogtreecommitdiffstats
path: root/src/internal-server/database/migrations/1566554231482_recipe_schema.js
blob: 41bebdacb76970c0e45df123612f8a9f0caade90 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/** @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;