diff options
author | vantezzen <properly@protonmail.com> | 2019-08-23 14:04:22 +0200 |
---|---|---|
committer | vantezzen <properly@protonmail.com> | 2019-08-23 14:04:22 +0200 |
commit | 5970b8e5bbf993c88c1f901708a7c5075a916770 (patch) | |
tree | 11636435cba3414a930b4a81f9bf7ca8d4de31e1 /database/migrations | |
parent | Fix user login (diff) | |
download | ferdium-server-5970b8e5bbf993c88c1f901708a7c5075a916770.tar.gz ferdium-server-5970b8e5bbf993c88c1f901708a7c5075a916770.tar.zst ferdium-server-5970b8e5bbf993c88c1f901708a7c5075a916770.zip |
Add support for workspaces
Diffstat (limited to 'database/migrations')
-rw-r--r-- | database/migrations/1566554231482_recipe_schema.js | 22 | ||||
-rw-r--r-- | database/migrations/1566554359294_workspace_schema.js | 25 |
2 files changed, 47 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 | ||
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 @@ | |||
1 | 'use strict' | ||
2 | |||
3 | /** @type {import('@adonisjs/lucid/src/Schema')} */ | ||
4 | const Schema = use('Schema') | ||
5 | |||
6 | class WorkspaceSchema extends Schema { | ||
7 | up () { | ||
8 | this.create('workspaces', (table) => { | ||
9 | table.increments() | ||
10 | table.string('workspaceId', 80).notNullable().unique() | ||
11 | table.string('userId', 80).notNullable() | ||
12 | table.string('name', 80).notNullable() | ||
13 | table.integer('order') | ||
14 | table.json('services') | ||
15 | table.json('data') | ||
16 | table.timestamps() | ||
17 | }) | ||
18 | } | ||
19 | |||
20 | down () { | ||
21 | this.drop('workspaces') | ||
22 | } | ||
23 | } | ||
24 | |||
25 | module.exports = WorkspaceSchema | ||