From fc642e0d14983279eeccb0d68fbb82981e85c58e Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Fri, 19 Apr 2019 20:46:49 +0800 Subject: [PATCH] fix: migration should return promise Signed-off-by: BoHong Li --- .../20171009121200-longtext-for-mysql.js | 20 +++++++++---------- .../20180209120907-longtext-of-authorship.js | 12 +++++------ lib/migrations/20180306150303-fix-enum.js | 8 ++++---- 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/migrations/20171009121200-longtext-for-mysql.js b/lib/migrations/20171009121200-longtext-for-mysql.js index cb9fc8a5..96bf7e87 100644 --- a/lib/migrations/20171009121200-longtext-for-mysql.js +++ b/lib/migrations/20171009121200-longtext-for-mysql.js @@ -1,16 +1,16 @@ 'use strict' module.exports = { - up: function (queryInterface, Sequelize) { - queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT('long') }) - queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT('long') }) - queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT('long') }) - queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT('long') }) + up: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT('long') }) + await queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT('long') }) + await queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT('long') }) + await queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT('long') }) }, - down: function (queryInterface, Sequelize) { - queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT }) - queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT }) - queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT }) - queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT }) + down: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'content', { type: Sequelize.TEXT }) + await queryInterface.changeColumn('Revisions', 'patch', { type: Sequelize.TEXT }) + await queryInterface.changeColumn('Revisions', 'content', { type: Sequelize.TEXT }) + await queryInterface.changeColumn('Revisions', 'lastContent', { type: Sequelize.TEXT }) } } diff --git a/lib/migrations/20180209120907-longtext-of-authorship.js b/lib/migrations/20180209120907-longtext-of-authorship.js index c5d8a1ef..04810009 100644 --- a/lib/migrations/20180209120907-longtext-of-authorship.js +++ b/lib/migrations/20180209120907-longtext-of-authorship.js @@ -1,13 +1,13 @@ 'use strict' module.exports = { - up: function (queryInterface, Sequelize) { - queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT('long') }) - queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT('long') }) + up: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT('long') }) + await queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT('long') }) }, - down: function (queryInterface, Sequelize) { - queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT }) - queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT }) + down: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'authorship', { type: Sequelize.TEXT }) + await queryInterface.changeColumn('Revisions', 'authorship', { type: Sequelize.TEXT }) } } diff --git a/lib/migrations/20180306150303-fix-enum.js b/lib/migrations/20180306150303-fix-enum.js index 433a9749..54bf1515 100644 --- a/lib/migrations/20180306150303-fix-enum.js +++ b/lib/migrations/20180306150303-fix-enum.js @@ -1,11 +1,11 @@ 'use strict' module.exports = { - up: function (queryInterface, Sequelize) { - queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private') }) + up: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'limited', 'locked', 'protected', 'private') }) }, - down: function (queryInterface, Sequelize) { - queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'locked', 'private') }) + down: async function (queryInterface, Sequelize) { + await queryInterface.changeColumn('Notes', 'permission', { type: Sequelize.ENUM('freely', 'editable', 'locked', 'private') }) } }