From 5970b8e5bbf993c88c1f901708a7c5075a916770 Mon Sep 17 00:00:00 2001 From: vantezzen Date: Fri, 23 Aug 2019 14:04:22 +0200 Subject: Add support for workspaces --- database/migrations/1566554231482_recipe_schema.js | 22 +++++++++++++++++++ .../migrations/1566554359294_workspace_schema.js | 25 ++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 database/migrations/1566554231482_recipe_schema.js create mode 100644 database/migrations/1566554359294_workspace_schema.js (limited to 'database/migrations') 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 @@ +'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 diff --git a/database/migrations/1566554359294_workspace_schema.js b/database/migrations/1566554359294_workspace_schema.js new file mode 100644 index 0000000..84e0bb9 --- /dev/null +++ b/database/migrations/1566554359294_workspace_schema.js @@ -0,0 +1,25 @@ +'use strict' + +/** @type {import('@adonisjs/lucid/src/Schema')} */ +const Schema = use('Schema') + +class WorkspaceSchema extends Schema { + up () { + this.create('workspaces', (table) => { + table.increments() + table.string('workspaceId', 80).notNullable().unique() + table.string('userId', 80).notNullable() + table.string('name', 80).notNullable() + table.integer('order') + table.json('services') + table.json('data') + table.timestamps() + }) + } + + down () { + this.drop('workspaces') + } +} + +module.exports = WorkspaceSchema -- cgit v1.2.3-54-g00ecf