From 29b8334b060dc0c05a509d523ead4b3a30229fef Mon Sep 17 00:00:00 2001 From: vantezzen Date: Thu, 5 Sep 2019 11:22:49 +0200 Subject: Add eslint --- database/factory.js | 1 - database/migrations/1503250034279_user.js | 23 ++++++++--------- database/migrations/1503250034280_token.js | 25 +++++++++---------- .../migrations/1566385379883_service_schema.js | 27 ++++++++++---------- database/migrations/1566554231482_recipe_schema.js | 23 ++++++++--------- .../migrations/1566554359294_workspace_schema.js | 29 +++++++++++----------- 6 files changed, 61 insertions(+), 67 deletions(-) (limited to 'database') diff --git a/database/factory.js b/database/factory.js index 16b5084..550c5e6 100644 --- a/database/factory.js +++ b/database/factory.js @@ -1,4 +1,3 @@ -'use strict' /* |-------------------------------------------------------------------------- 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 @@ -'use strict' /** @type {import('@adonisjs/lucid/src/Schema')} */ -const Schema = use('Schema') +const Schema = use('Schema'); class UserSchema extends Schema { - up () { + up() { this.create('users', (table) => { - table.increments() - table.string('username', 80).notNullable() - table.string('email', 254).notNullable().unique() - table.string('password', 60).notNullable() - table.timestamps() - }) + table.increments(); + table.string('username', 80).notNullable(); + table.string('email', 254).notNullable().unique(); + table.string('password', 60).notNullable(); + table.timestamps(); + }); } - down () { - this.drop('users') + down() { + this.drop('users'); } } -module.exports = UserSchema +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 @@ -'use strict' /** @type {import('@adonisjs/lucid/src/Schema')} */ -const Schema = use('Schema') +const Schema = use('Schema'); class TokensSchema extends Schema { - up () { + up() { this.create('tokens', (table) => { - table.increments() - table.integer('user_id').unsigned().references('id').inTable('users') - table.string('token', 255).notNullable().unique().index() - table.string('type', 80).notNullable() - table.boolean('is_revoked').defaultTo(false) - table.timestamps() - }) + table.increments(); + table.integer('user_id').unsigned().references('id').inTable('users'); + table.string('token', 255).notNullable().unique().index(); + table.string('type', 80).notNullable(); + table.boolean('is_revoked').defaultTo(false); + table.timestamps(); + }); } - down () { - this.drop('tokens') + down() { + this.drop('tokens'); } } -module.exports = TokensSchema +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 @@ -'use strict' /** @type {import('@adonisjs/lucid/src/Schema')} */ -const Schema = use('Schema') +const Schema = use('Schema'); class ServiceSchema extends Schema { - up () { + up() { this.create('services', (table) => { - table.increments() - table.string('userId', 80).notNullable() - table.string('serviceId', 80).notNullable() - table.string('name', 80).notNullable() - table.string('recipeId', 254).notNullable() - table.json('settings') - table.timestamps() - }) + table.increments(); + table.string('userId', 80).notNullable(); + table.string('serviceId', 80).notNullable(); + table.string('name', 80).notNullable(); + table.string('recipeId', 254).notNullable(); + table.json('settings'); + table.timestamps(); + }); } - down () { - this.drop('services') + down() { + this.drop('services'); } } -module.exports = ServiceSchema +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 @@ -'use strict' /** @type {import('@adonisjs/lucid/src/Schema')} */ -const Schema = use('Schema') +const Schema = use('Schema'); class RecipeSchema extends Schema { - up () { + up() { this.create('recipes', (table) => { - table.increments() - table.string('name', 80).notNullable() - table.string('recipeId', 254).notNullable().unique() - table.json('data') - table.timestamps() - }) + table.increments(); + table.string('name', 80).notNullable(); + table.string('recipeId', 254).notNullable().unique(); + table.json('data'); + table.timestamps(); + }); } - down () { - this.drop('recipes') + down() { + this.drop('recipes'); } } -module.exports = RecipeSchema +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 @@ -'use strict' /** @type {import('@adonisjs/lucid/src/Schema')} */ -const Schema = use('Schema') +const Schema = use('Schema'); class WorkspaceSchema extends Schema { - up () { + 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() - }) + 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') + down() { + this.drop('workspaces'); } } -module.exports = WorkspaceSchema +module.exports = WorkspaceSchema; -- cgit v1.2.3-54-g00ecf