try with path.join

This commit is contained in:
Moriz Wahl 2021-12-29 12:59:25 +01:00
parent dc3f86f0c6
commit 0cd6a40304

View File

@ -1,6 +1,7 @@
import CONFIG from './config'
import { createPool, PoolConfig } from 'mysql'
import { Migration } from 'ts-mysql-migrate'
import path from 'path'
const poolConfig: PoolConfig = {
host: CONFIG.DB_HOST,
@ -18,7 +19,7 @@ const migration = new Migration({
conn: pool,
tableName: CONFIG.MIGRATIONS_TABLE,
silent: true,
dir: CONFIG.MIGRATIONS_DIRECTORY,
dir: path.join(__dirname, '..', CONFIG.MIGRATIONS_DIRECTORY),
})
const initialize = async (): Promise<void> => {