From 81e3d7bd00686b5e4d1e0b53db3eca9901c183c1 Mon Sep 17 00:00:00 2001 From: Sheogorath Date: Wed, 5 Sep 2018 15:08:32 +0100 Subject: Extend migration error handling The current error handling seems to conflict with some sequelize versions. So we add a second version of it in our excemptions. I'm not happy about it, but when it helps to prevent further migration breaking, it's worth it. Signed-off-by: Sheogorath --- lib/migrations/20160515114000-user-add-tokens.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/migrations/20160515114000-user-add-tokens.js') diff --git a/lib/migrations/20160515114000-user-add-tokens.js b/lib/migrations/20160515114000-user-add-tokens.js index 4245f1ad..8bf6d11f 100644 --- a/lib/migrations/20160515114000-user-add-tokens.js +++ b/lib/migrations/20160515114000-user-add-tokens.js @@ -4,7 +4,7 @@ module.exports = { return queryInterface.addColumn('Users', 'accessToken', Sequelize.STRING).then(function () { return queryInterface.addColumn('Users', 'refreshToken', Sequelize.STRING) }).catch(function (error) { - if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'accessToken'") { + if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'accessToken'" || error.message === 'column "accessToken" of relation "Users" already exists') { console.log('Migration has already run… ignoring.') } else { throw error -- cgit v1.2.3