diff options
Diffstat (limited to 'database/migrations')
-rw-r--r-- | database/migrations/1503250034279_user.js | 23 | ||||
-rw-r--r-- | database/migrations/1503250034280_token.js | 25 | ||||
-rw-r--r-- | database/migrations/1566385379883_service_schema.js | 27 | ||||
-rw-r--r-- | database/migrations/1566554231482_recipe_schema.js | 23 | ||||
-rw-r--r-- | database/migrations/1566554359294_workspace_schema.js | 29 |
5 files changed, 61 insertions, 66 deletions
diff --git a/database/migrations/1503250034279_user.js b/database/migrations/1503250034279_user.js index 9148593..5010bec 100644 --- a/database/migrations/1503250034279_user.js +++ b/database/migrations/1503250034279_user.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 UserSchema extends Schema { | 5 | class UserSchema extends Schema { |
7 | up () { | 6 | up() { |
8 | this.create('users', (table) => { | 7 | this.create('users', (table) => { |
9 | table.increments() | 8 | table.increments(); |
10 | table.string('username', 80).notNullable() | 9 | table.string('username', 80).notNullable(); |
11 | table.string('email', 254).notNullable().unique() | 10 | table.string('email', 254).notNullable().unique(); |
12 | table.string('password', 60).notNullable() | 11 | table.string('password', 60).notNullable(); |
13 | table.timestamps() | 12 | table.timestamps(); |
14 | }) | 13 | }); |
15 | } | 14 | } |
16 | 15 | ||
17 | down () { | 16 | down() { |
18 | this.drop('users') | 17 | this.drop('users'); |
19 | } | 18 | } |
20 | } | 19 | } |
21 | 20 | ||
22 | module.exports = UserSchema | 21 | module.exports = UserSchema; |
diff --git a/database/migrations/1503250034280_token.js b/database/migrations/1503250034280_token.js index c8bb9fc..ad97dba 100644 --- a/database/migrations/1503250034280_token.js +++ b/database/migrations/1503250034280_token.js | |||
@@ -1,23 +1,22 @@ | |||
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 TokensSchema extends Schema { | 5 | class TokensSchema extends Schema { |
7 | up () { | 6 | up() { |
8 | this.create('tokens', (table) => { | 7 | this.create('tokens', (table) => { |
9 | table.increments() | 8 | table.increments(); |
10 | table.integer('user_id').unsigned().references('id').inTable('users') | 9 | table.integer('user_id').unsigned().references('id').inTable('users'); |
11 | table.string('token', 255).notNullable().unique().index() | 10 | table.string('token', 255).notNullable().unique().index(); |
12 | table.string('type', 80).notNullable() | 11 | table.string('type', 80).notNullable(); |
13 | table.boolean('is_revoked').defaultTo(false) | 12 | table.boolean('is_revoked').defaultTo(false); |
14 | table.timestamps() | 13 | table.timestamps(); |
15 | }) | 14 | }); |
16 | } | 15 | } |
17 | 16 | ||
18 | down () { | 17 | down() { |
19 | this.drop('tokens') | 18 | this.drop('tokens'); |
20 | } | 19 | } |
21 | } | 20 | } |
22 | 21 | ||
23 | module.exports = TokensSchema | 22 | module.exports = TokensSchema; |
diff --git a/database/migrations/1566385379883_service_schema.js b/database/migrations/1566385379883_service_schema.js index a725699..093fb13 100644 --- a/database/migrations/1566385379883_service_schema.js +++ b/database/migrations/1566385379883_service_schema.js | |||
@@ -1,24 +1,23 @@ | |||
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 ServiceSchema extends Schema { | 5 | class ServiceSchema extends Schema { |
7 | up () { | 6 | up() { |
8 | this.create('services', (table) => { | 7 | this.create('services', (table) => { |
9 | table.increments() | 8 | table.increments(); |
10 | table.string('userId', 80).notNullable() | 9 | table.string('userId', 80).notNullable(); |
11 | table.string('serviceId', 80).notNullable() | 10 | table.string('serviceId', 80).notNullable(); |
12 | table.string('name', 80).notNullable() | 11 | table.string('name', 80).notNullable(); |
13 | table.string('recipeId', 254).notNullable() | 12 | table.string('recipeId', 254).notNullable(); |
14 | table.json('settings') | 13 | table.json('settings'); |
15 | table.timestamps() | 14 | table.timestamps(); |
16 | }) | 15 | }); |
17 | } | 16 | } |
18 | 17 | ||
19 | down () { | 18 | down() { |
20 | this.drop('services') | 19 | this.drop('services'); |
21 | } | 20 | } |
22 | } | 21 | } |
23 | 22 | ||
24 | module.exports = ServiceSchema | 23 | module.exports = ServiceSchema; |
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; |
diff --git a/database/migrations/1566554359294_workspace_schema.js b/database/migrations/1566554359294_workspace_schema.js index 84e0bb9..0a3c138 100644 --- a/database/migrations/1566554359294_workspace_schema.js +++ b/database/migrations/1566554359294_workspace_schema.js | |||
@@ -1,25 +1,24 @@ | |||
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 WorkspaceSchema extends Schema { | 5 | class WorkspaceSchema extends Schema { |
7 | up () { | 6 | up() { |
8 | this.create('workspaces', (table) => { | 7 | this.create('workspaces', (table) => { |
9 | table.increments() | 8 | table.increments(); |
10 | table.string('workspaceId', 80).notNullable().unique() | 9 | table.string('workspaceId', 80).notNullable().unique(); |
11 | table.string('userId', 80).notNullable() | 10 | table.string('userId', 80).notNullable(); |
12 | table.string('name', 80).notNullable() | 11 | table.string('name', 80).notNullable(); |
13 | table.integer('order') | 12 | table.integer('order'); |
14 | table.json('services') | 13 | table.json('services'); |
15 | table.json('data') | 14 | table.json('data'); |
16 | table.timestamps() | 15 | table.timestamps(); |
17 | }) | 16 | }); |
18 | } | 17 | } |
19 | 18 | ||
20 | down () { | 19 | down() { |
21 | this.drop('workspaces') | 20 | this.drop('workspaces'); |
22 | } | 21 | } |
23 | } | 22 | } |
24 | 23 | ||
25 | module.exports = WorkspaceSchema | 24 | module.exports = WorkspaceSchema; |