From 120225947f6c22c8e7f8b9c2b72f496784162647 Mon Sep 17 00:00:00 2001 From: Tilman Vatteroth Date: Wed, 2 Dec 2020 17:22:27 +0100 Subject: Catch more errors Signed-off-by: Tilman Vatteroth --- lib/migrations/20160515114000-user-add-tokens.js | 3 ++- 1 file changed, 2 insertions(+), 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 e47ef5a4..33457824 100644 --- a/lib/migrations/20160515114000-user-add-tokens.js +++ b/lib/migrations/20160515114000-user-add-tokens.js @@ -4,7 +4,8 @@ module.exports = { return queryInterface.addColumn('Users', 'accessToken', Sequelize.STRING).then(function () { return queryInterface.addColumn('Users', 'refreshToken', Sequelize.STRING) }).catch(function (error) { - if (error.message === 'SQLITE_ERROR: duplicate column name: accessToken' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'accessToken'" || error.message === 'column "accessToken" of relation "Users" already exists') { + if (error.message.toLowerCase().includes('duplicate column name') || + error.message === 'column "accessToken" of relation "Users" already exists') { // eslint-disable-next-line no-console console.log('Migration has already run… ignoring.') } else { -- cgit v1.2.3