diff options
Diffstat (limited to 'lib/migrations/20161201050312-support-email-signin.js')
-rw-r--r-- | lib/migrations/20161201050312-support-email-signin.js | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/migrations/20161201050312-support-email-signin.js b/lib/migrations/20161201050312-support-email-signin.js index d33225f1..4653e67a 100644 --- a/lib/migrations/20161201050312-support-email-signin.js +++ b/lib/migrations/20161201050312-support-email-signin.js @@ -2,7 +2,19 @@ module.exports = { up: function (queryInterface, Sequelize) { return queryInterface.addColumn('Users', 'email', Sequelize.TEXT).then(function () { - return queryInterface.addColumn('Users', 'password', Sequelize.TEXT) + return queryInterface.addColumn('Users', 'password', Sequelize.TEXT).catch(function (error) { + if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'password'") { + console.log('Migration has already run… ignoring.') + } else { + throw error + } + }) + }).catch(function (error) { + if (error.message === "ER_DUP_FIELDNAME: Duplicate column name 'email'") { + console.log('Migration has already run… ignoring.') + } else { + throw error + } }) }, |