From 26a14dd987b2021f7652bf14da83046eeca2dd6c Mon Sep 17 00:00:00 2001 From: Hugo Caloto Date: Mon, 9 Jul 2018 09:27:17 +0200 Subject: Add missing catch blocks for migration from 1.1.1 to 1.2.0 Signed-off-by: Hugo Caloto --- lib/migrations/20160703062241-support-authorship.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/migrations/20160703062241-support-authorship.js') diff --git a/lib/migrations/20160703062241-support-authorship.js b/lib/migrations/20160703062241-support-authorship.js index d73923b0..b3ced8c4 100644 --- a/lib/migrations/20160703062241-support-authorship.js +++ b/lib/migrations/20160703062241-support-authorship.js @@ -16,6 +16,12 @@ module.exports = { createdAt: Sequelize.DATE, updatedAt: Sequelize.DATE }) + }).catch(function (error) { + if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'authorship'") { + console.log('Migration has already run… ignoring.') + } else { + throw error + } }) }, -- cgit v1.2.3