[Migrations] Replace similar code

Signed-off-by: Tilman Vatteroth <tilman.vatteroth@tu-dortmund.de>
This commit is contained in:
Tilman Vatteroth 2020-11-30 17:39:50 +01:00
parent a157599884
commit 4ae80a3ed0
No known key found for this signature in database
GPG key ID: DEBDB3F34641B019

View file

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