summaryrefslogtreecommitdiff
path: root/lib/migrations/20161201050312-support-email-signin.js
diff options
context:
space:
mode:
authorChristoph (Sheogorath) Kern2018-07-31 10:26:39 +0200
committerGitHub2018-07-31 10:26:39 +0200
commit48ddcef31c4c13557e1bd2fbc128e82e0e2df5d8 (patch)
tree7266f4fd8f36e4d37c30519a39838520e9bce0bc /lib/migrations/20161201050312-support-email-signin.js
parent93a3ce1164f69af24381c94b941048580891e1b8 (diff)
parent26a14dd987b2021f7652bf14da83046eeca2dd6c (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 'lib/migrations/20161201050312-support-email-signin.js')
-rw-r--r--lib/migrations/20161201050312-support-email-signin.js14
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
+ }
})
},