summaryrefslogtreecommitdiff
path: root/lib/migrations/20161009040430-support-delete-note.js
diff options
context:
space:
mode:
authorHugo Caloto2018-07-09 09:27:17 +0200
committerHugo Caloto2018-07-31 08:19:57 +0200
commit26a14dd987b2021f7652bf14da83046eeca2dd6c (patch)
tree29d3b5be27b41b54c69e3bc92db9a3f359f7bd6e /lib/migrations/20161009040430-support-delete-note.js
parent429257880b4ecfdfb9c07601a6baa1beb84a0adc (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 'lib/migrations/20161009040430-support-delete-note.js')
-rw-r--r--lib/migrations/20161009040430-support-delete-note.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/migrations/20161009040430-support-delete-note.js b/lib/migrations/20161009040430-support-delete-note.js
index a39d1086..4df7a81c 100644
--- a/lib/migrations/20161009040430-support-delete-note.js
+++ b/lib/migrations/20161009040430-support-delete-note.js
@@ -1,7 +1,13 @@
'use strict'
module.exports = {
up: function (queryInterface, Sequelize) {
- return queryInterface.addColumn('Notes', 'deletedAt', Sequelize.DATE)
+ return queryInterface.addColumn('Notes', 'deletedAt', Sequelize.DATE).catch(function (error) {
+ if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'deletedAt'") {
+ console.log('Migration has already run… ignoring.')
+ } else {
+ throw error
+ }
+ })
},
down: function (queryInterface, Sequelize) {