diff options
author | Hugo Caloto | 2018-07-09 09:27:17 +0200 |
---|---|---|
committer | Hugo Caloto | 2018-07-31 08:19:57 +0200 |
commit | 26a14dd987b2021f7652bf14da83046eeca2dd6c (patch) | |
tree | 29d3b5be27b41b54c69e3bc92db9a3f359f7bd6e /lib/migrations/20160112220142-note-add-lastchange.js | |
parent | 429257880b4ecfdfb9c07601a6baa1beb84a0adc (diff) |
Add missing catch blocks for migration from 1.1.1 to 1.2.0
Signed-off-by: Hugo Caloto <hcaloto@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | lib/migrations/20160112220142-note-add-lastchange.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/migrations/20160112220142-note-add-lastchange.js b/lib/migrations/20160112220142-note-add-lastchange.js index b4e111b3..d0030d6b 100644 --- a/lib/migrations/20160112220142-note-add-lastchange.js +++ b/lib/migrations/20160112220142-note-add-lastchange.js @@ -7,6 +7,12 @@ module.exports = { return queryInterface.addColumn('Notes', 'lastchangeAt', { type: Sequelize.DATE }) + }).catch(function (error) { + if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'lastchangeuserId'") { + console.log('Migration has already run… ignoring.') + } else { + throw error + } }) }, |