diff options
Diffstat (limited to 'database/migrations/1566554231482_recipe_schema.js')
-rw-r--r-- | database/migrations/1566554231482_recipe_schema.js | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/database/migrations/1566554231482_recipe_schema.js b/database/migrations/1566554231482_recipe_schema.js index 7d8f5a8..14fcb82 100644 --- a/database/migrations/1566554231482_recipe_schema.js +++ b/database/migrations/1566554231482_recipe_schema.js | |||
@@ -1,22 +1,21 @@ | |||
1 | 'use strict' | ||
2 | 1 | ||
3 | /** @type {import('@adonisjs/lucid/src/Schema')} */ | 2 | /** @type {import('@adonisjs/lucid/src/Schema')} */ |
4 | const Schema = use('Schema') | 3 | const Schema = use('Schema'); |
5 | 4 | ||
6 | class RecipeSchema extends Schema { | 5 | class RecipeSchema extends Schema { |
7 | up () { | 6 | up() { |
8 | this.create('recipes', (table) => { | 7 | this.create('recipes', (table) => { |
9 | table.increments() | 8 | table.increments(); |
10 | table.string('name', 80).notNullable() | 9 | table.string('name', 80).notNullable(); |
11 | table.string('recipeId', 254).notNullable().unique() | 10 | table.string('recipeId', 254).notNullable().unique(); |
12 | table.json('data') | 11 | table.json('data'); |
13 | table.timestamps() | 12 | table.timestamps(); |
14 | }) | 13 | }); |
15 | } | 14 | } |
16 | 15 | ||
17 | down () { | 16 | down() { |
18 | this.drop('recipes') | 17 | this.drop('recipes'); |
19 | } | 18 | } |
20 | } | 19 | } |
21 | 20 | ||
22 | module.exports = RecipeSchema | 21 | module.exports = RecipeSchema; |