Catch more errors
Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
@@ -4,6 +4,14 @@ module.exports = {
|
||||
return queryInterface.addColumn('Users', 'deleteToken', {
|
||||
type: Sequelize.UUID,
|
||||
defaultValue: Sequelize.UUIDV4
|
||||
}).catch(function (error) {
|
||||
if (error.message.toLowerCase().includes('duplicate column name') ||
|
||||
error.message === 'column "deleteToken" of relation "Users" already exists') {
|
||||
// eslint-disable-next-line no-console
|
||||
console.log('Migration has already run… ignoring.')
|
||||
} else {
|
||||
throw error
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user