Skip to content

Commit fcea7a3

Browse files
authored
Use shorthand functions in migration files (#954)
1 parent ab98586 commit fcea7a3

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/assets/migrations/create-table.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
module.exports = {
4-
up: async (queryInterface, Sequelize) => {
4+
async up (queryInterface, Sequelize) {
55
await queryInterface.createTable('<%= tableName %>', {
66
id: {
77
allowNull: false,
@@ -28,7 +28,7 @@ module.exports = {
2828
});
2929
},
3030

31-
down: async (queryInterface, Sequelize) => {
31+
async down (queryInterface, Sequelize) {
3232
await queryInterface.dropTable('<%= tableName %>');
3333
}
3434
};

src/assets/migrations/skeleton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
module.exports = {
4-
up: async (queryInterface, Sequelize) => {
4+
async up (queryInterface, Sequelize) {
55
/**
66
* Add altering commands here.
77
*
@@ -10,7 +10,7 @@ module.exports = {
1010
*/
1111
},
1212

13-
down: async (queryInterface, Sequelize) => {
13+
async down (queryInterface, Sequelize) {
1414
/**
1515
* Add reverting commands here.
1616
*

src/assets/seeders/skeleton.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

33
module.exports = {
4-
up: async (queryInterface, Sequelize) => {
4+
async up (queryInterface, Sequelize) {
55
/**
66
* Add seed commands here.
77
*
@@ -13,7 +13,7 @@ module.exports = {
1313
*/
1414
},
1515

16-
down: async (queryInterface, Sequelize) => {
16+
async down (queryInterface, Sequelize) {
1717
/**
1818
* Add commands to revert seed here.
1919
*

test/migration/create.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ const gulp = require('gulp');
4646
.pipe(
4747
helpers.expect((stdout) => {
4848
expect(stdout).to.contain(
49-
'up: async (queryInterface, Sequelize) => {'
49+
'async up (queryInterface, Sequelize) {'
5050
);
5151
expect(stdout).to.contain(
52-
'down: async (queryInterface, Sequelize) => {'
52+
'async down (queryInterface, Sequelize) {'
5353
);
5454
})
5555
)

test/seed/create.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ const gulp = require('gulp');
4848
.pipe(
4949
helpers.expect((stdout) => {
5050
expect(stdout).to.contain(
51-
'up: async (queryInterface, Sequelize) => {'
51+
'async up (queryInterface, Sequelize) {'
5252
);
5353
expect(stdout).to.contain(
54-
'down: async (queryInterface, Sequelize) => {'
54+
'async down (queryInterface, Sequelize) {'
5555
);
5656
})
5757
)

0 commit comments

Comments
 (0)