fix: Database config should resolve entities and migrations folder relative to it's path (no-changelog) (#4527)

dbconfig should resolve entities and migrations folder relative to itself
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2022-11-04 18:45:37 +01:00 committed by GitHub
parent 41cb0eec6e
commit 4517c4a90a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,11 +12,11 @@ import type { DatabaseType } from '../Interfaces';
import config from '../../config';
import { getConfigValue } from '../GenericHelpers';
const entitiesDir = path.resolve('src', 'databases', 'entities');
const entitiesDir = path.resolve(__dirname, 'entities');
const getDBConnectionOptions = (dbType: DatabaseType) => {
const entityPrefix = config.getEnv('database.tablePrefix');
const migrationsDir = path.resolve('src', 'databases', 'migrations', dbType);
const migrationsDir = path.resolve(__dirname, 'migrations', dbType);
const configDBType = dbType === 'mariadb' ? 'mysqldb' : dbType;
const connectionDetails =
configDBType === 'sqlite'