Catch more errors

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-12-02 17:22:27 +01:00
parent 4ae80a3ed0
commit 120225947f
No known key found for this signature in database
GPG key ID: DEBDB3F34641B019
9 changed files with 31 additions and 10 deletions

View file

@ -2,7 +2,8 @@
module.exports = {
up: function (queryInterface, Sequelize) {
return queryInterface.addColumn('Notes', 'deletedAt', Sequelize.DATE).catch(function (error) {
if (error.message === 'SQLITE_ERROR: duplicate column name: deletedAt' || error.message === "ER_DUP_FIELDNAME: Duplicate column name 'deletedAt'" || error.message === 'column "deletedAt" of relation "Notes" already exists') {
if (error.message.toLowerCase().includes('duplicate column name') ||
error.message === 'column "deletedAt" of relation "Notes" already exists') {
// eslint-disable-next-line no-console
console.log('Migration has already run… ignoring.')
} else {