mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
fix migrations to use only the entity model
This commit is contained in:
parent
165f86bdb1
commit
b043bbe79b
@ -1,11 +1,8 @@
|
|||||||
import { getConnection } from 'typeorm'
|
|
||||||
import { Migration } from './entity/Migration'
|
import { Migration } from './entity/Migration'
|
||||||
|
|
||||||
const getDBVersion = async (): Promise<string | null> => {
|
const getDBVersion = async (): Promise<string | null> => {
|
||||||
const connection = getConnection()
|
|
||||||
const migrations = connection.getRepository(Migration)
|
|
||||||
try {
|
try {
|
||||||
const dbVersion = await migrations.findOne({ order: { version: 'DESC' } })
|
const dbVersion = await Migration.findOne({ order: { version: 'DESC' } })
|
||||||
return dbVersion ? dbVersion.fileName : null
|
return dbVersion ? dbVersion.fileName : null
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
return null
|
return null
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user