Skip to content

Commit

Permalink
Use shorthand functions in migration files (#954)
Browse files Browse the repository at this point in the history
  • Loading branch information
zvizvi authored Nov 10, 2021
1 parent ab98586 commit fcea7a3
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/assets/migrations/create-table.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
async up (queryInterface, Sequelize) {
await queryInterface.createTable('<%= tableName %>', {
id: {
allowNull: false,
Expand All @@ -28,7 +28,7 @@ module.exports = {
});
},

down: async (queryInterface, Sequelize) => {
async down (queryInterface, Sequelize) {
await queryInterface.dropTable('<%= tableName %>');
}
};
4 changes: 2 additions & 2 deletions src/assets/migrations/skeleton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
async up (queryInterface, Sequelize) {
/**
* Add altering commands here.
*
Expand All @@ -10,7 +10,7 @@ module.exports = {
*/
},

down: async (queryInterface, Sequelize) => {
async down (queryInterface, Sequelize) {
/**
* Add reverting commands here.
*
Expand Down
4 changes: 2 additions & 2 deletions src/assets/seeders/skeleton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';

module.exports = {
up: async (queryInterface, Sequelize) => {
async up (queryInterface, Sequelize) {
/**
* Add seed commands here.
*
Expand All @@ -13,7 +13,7 @@ module.exports = {
*/
},

down: async (queryInterface, Sequelize) => {
async down (queryInterface, Sequelize) {
/**
* Add commands to revert seed here.
*
Expand Down
4 changes: 2 additions & 2 deletions test/migration/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {'
);
})
)
Expand Down
4 changes: 2 additions & 2 deletions test/seed/create.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {'
);
})
)
Expand Down

0 comments on commit fcea7a3

Please sign in to comment.