Skip to content

Commit

Permalink
fix: Database config should resolve entities and migrations folder re…
Browse files Browse the repository at this point in the history
…lative to it's path (no-changelog) (#4527)

dbconfig should resolve entities and migrations folder relative to itself
  • Loading branch information
netroy authored Nov 4, 2022
1 parent 41cb0ee commit 4517c4a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/databases/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 4517c4a

Please sign in to comment.