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/20161201050312-support-email-signin.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/migrations/20161201050312-support-email-signin.js') diff --git a/lib/migrations/20161201050312-support-email-signin.js b/lib/migrations/20161201050312-support-email-signin.js index 4653e67a..0a8a832d 100644 --- a/lib/migrations/20161201050312-support-email-signin.js +++ b/lib/migrations/20161201050312-support-email-signin.js @@ -3,14 +3,14 @@ module.exports = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Users', 'email', Sequelize.TEXT).then(function () { return queryInterface.addColumn('Users', 'password', Sequelize.TEXT).catch(function (error) { - if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'password'") { + if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'password'" || error.message === 'column "password" of relation "Users" already exists') { console.log('Migration has already run… ignoring.') } else { throw error } }) }).catch(function (error) { - if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'email'") { + if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'email'" || error.message === 'column "email" of relation "Users" already exists') { console.log('Migration has already run… ignoring.') } else { throw error -- cgit v1.2.3