diff --git a/backend/src/typeorm/getDBVersion.ts b/backend/src/typeorm/getDBVersion.ts index 497a6da5e..32f0ab90d 100644 --- a/backend/src/typeorm/getDBVersion.ts +++ b/backend/src/typeorm/getDBVersion.ts @@ -1,11 +1,8 @@ -import { getConnection } from 'typeorm' import { Migration } from './entity/Migration' const getDBVersion = async (): Promise => { - const connection = getConnection() - const migrations = connection.getRepository(Migration) try { - const dbVersion = await migrations.findOne({ order: { version: 'DESC' } }) + const dbVersion = await Migration.findOne({ order: { version: 'DESC' } }) return dbVersion ? dbVersion.fileName : null } catch (error) { return null