Add missing catch

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-12-02 19:39:06 +01:00
parent 120225947f
commit 0318ce3e83
No known key found for this signature in database
GPG key ID: DEBDB3F34641B019

View file

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