From fcea7a36b66906ccf3e488bb5b1eb9648f1f5287 Mon Sep 17 00:00:00 2001 From: zvizvi <5633910@gmail.com> Date: Wed, 10 Nov 2021 11:07:39 +0200 Subject: [PATCH] Use shorthand functions in migration files (#954) --- src/assets/migrations/create-table.js | 4 ++-- src/assets/migrations/skeleton.js | 4 ++-- src/assets/seeders/skeleton.js | 4 ++-- test/migration/create.test.js | 4 ++-- test/seed/create.test.js | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/assets/migrations/create-table.js b/src/assets/migrations/create-table.js index 1a6c0ca5..0424a13d 100644 --- a/src/assets/migrations/create-table.js +++ b/src/assets/migrations/create-table.js @@ -1,7 +1,7 @@ 'use strict'; module.exports = { - up: async (queryInterface, Sequelize) => { + async up (queryInterface, Sequelize) { await queryInterface.createTable('<%= tableName %>', { id: { allowNull: false, @@ -28,7 +28,7 @@ module.exports = { }); }, - down: async (queryInterface, Sequelize) => { + async down (queryInterface, Sequelize) { await queryInterface.dropTable('<%= tableName %>'); } }; diff --git a/src/assets/migrations/skeleton.js b/src/assets/migrations/skeleton.js index 49064bf5..a740c9a2 100644 --- a/src/assets/migrations/skeleton.js +++ b/src/assets/migrations/skeleton.js @@ -1,7 +1,7 @@ 'use strict'; module.exports = { - up: async (queryInterface, Sequelize) => { + async up (queryInterface, Sequelize) { /** * Add altering commands here. * @@ -10,7 +10,7 @@ module.exports = { */ }, - down: async (queryInterface, Sequelize) => { + async down (queryInterface, Sequelize) { /** * Add reverting commands here. * diff --git a/src/assets/seeders/skeleton.js b/src/assets/seeders/skeleton.js index f1072a1f..1b9bf017 100644 --- a/src/assets/seeders/skeleton.js +++ b/src/assets/seeders/skeleton.js @@ -1,7 +1,7 @@ 'use strict'; module.exports = { - up: async (queryInterface, Sequelize) => { + async up (queryInterface, Sequelize) { /** * Add seed commands here. * @@ -13,7 +13,7 @@ module.exports = { */ }, - down: async (queryInterface, Sequelize) => { + async down (queryInterface, Sequelize) { /** * Add commands to revert seed here. * diff --git a/test/migration/create.test.js b/test/migration/create.test.js index 211a58e2..a09dee67 100644 --- a/test/migration/create.test.js +++ b/test/migration/create.test.js @@ -46,10 +46,10 @@ const gulp = require('gulp'); .pipe( helpers.expect((stdout) => { expect(stdout).to.contain( - 'up: async (queryInterface, Sequelize) => {' + 'async up (queryInterface, Sequelize) {' ); expect(stdout).to.contain( - 'down: async (queryInterface, Sequelize) => {' + 'async down (queryInterface, Sequelize) {' ); }) ) diff --git a/test/seed/create.test.js b/test/seed/create.test.js index 81937bdc..19f6dd4f 100644 --- a/test/seed/create.test.js +++ b/test/seed/create.test.js @@ -48,10 +48,10 @@ const gulp = require('gulp'); .pipe( helpers.expect((stdout) => { expect(stdout).to.contain( - 'up: async (queryInterface, Sequelize) => {' + 'async up (queryInterface, Sequelize) {' ); expect(stdout).to.contain( - 'down: async (queryInterface, Sequelize) => {' + 'async down (queryInterface, Sequelize) {' ); }) )