more error logging for debugging purposes

This commit is contained in:
Ulf Gebhardt 2021-10-12 01:27:20 +02:00
parent aa07ef2231
commit 14e3c33cc5
No known key found for this signature in database
GPG Key ID: 81308EFE29ABFEBD

View File

@ -1,10 +1,13 @@
import { getRepository } from 'typeorm'
import { Migration } from '@entity/Migration'
const getDBVersion = async (): Promise<string | null> => {
try {
const dbVersion = await Migration.findOne({ order: { version: 'DESC' } })
const dbVersion = await getRepository(Migration).findOne({ order: { version: 'DESC' } })
return dbVersion ? dbVersion.fileName : null
} catch (error) {
// eslint-disable-next-line no-console
console.log(error)
return null
}
}