aboutsummaryrefslogtreecommitdiffstats
path: root/database/migrations
diff options
context:
space:
mode:
authorLibravatar vantezzen <properly@protonmail.com>2019-09-05 11:22:49 +0200
committerLibravatar vantezzen <properly@protonmail.com>2019-09-05 11:22:49 +0200
commit29b8334b060dc0c05a509d523ead4b3a30229fef (patch)
tree4dbfcfb90a3eff31acd219b27557bbdc594f589f /database/migrations
parentAdd cookie notice to login page (diff)
downloadferdium-server-29b8334b060dc0c05a509d523ead4b3a30229fef.tar.gz
ferdium-server-29b8334b060dc0c05a509d523ead4b3a30229fef.tar.zst
ferdium-server-29b8334b060dc0c05a509d523ead4b3a30229fef.zip
Add eslint
Diffstat (limited to 'database/migrations')
-rw-r--r--database/migrations/1503250034279_user.js23
-rw-r--r--database/migrations/1503250034280_token.js25
-rw-r--r--database/migrations/1566385379883_service_schema.js27
-rw-r--r--database/migrations/1566554231482_recipe_schema.js23
-rw-r--r--database/migrations/1566554359294_workspace_schema.js29
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')} */
4const Schema = use('Schema') 3const Schema = use('Schema');
5 4
6class UserSchema extends Schema { 5class 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
22module.exports = UserSchema 21module.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')} */
4const Schema = use('Schema') 3const Schema = use('Schema');
5 4
6class TokensSchema extends Schema { 5class 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
23module.exports = TokensSchema 22module.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')} */
4const Schema = use('Schema') 3const Schema = use('Schema');
5 4
6class ServiceSchema extends Schema { 5class 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
24module.exports = ServiceSchema 23module.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')} */
4const Schema = use('Schema') 3const Schema = use('Schema');
5 4
6class RecipeSchema extends Schema { 5class 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
22module.exports = RecipeSchema 21module.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')} */
4const Schema = use('Schema') 3const Schema = use('Schema');
5 4
6class WorkspaceSchema extends Schema { 5class 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
25module.exports = WorkspaceSchema 24module.exports = WorkspaceSchema;