diff options
author | Christoph (Sheogorath) Kern | 2018-07-31 10:26:39 +0200 |
---|---|---|
committer | GitHub | 2018-07-31 10:26:39 +0200 |
commit | 48ddcef31c4c13557e1bd2fbc128e82e0e2df5d8 (patch) | |
tree | 7266f4fd8f36e4d37c30519a39838520e9bce0bc /lib/migrations/20161009040430-support-delete-note.js | |
parent | 93a3ce1164f69af24381c94b941048580891e1b8 (diff) | |
parent | 26a14dd987b2021f7652bf14da83046eeca2dd6c (diff) |
Merge pull request #894 from hcaloto/fixMigrationIssues
Add missing catch blocks for migration from 1.1.1 to 1.2.0
Diffstat (limited to '')
-rw-r--r-- | lib/migrations/20161009040430-support-delete-note.js | 8 |
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) { |