From b043bbe79b5d49dacf6d2386e967614cf3ef31dd Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Fri, 1 Oct 2021 19:20:02 +0200 Subject: [PATCH] fix migrations to use only the entity model --- backend/src/typeorm/getDBVersion.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) 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