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