X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=mikro-orm.config-template.ts;h=4ef43dff66fb4dec4af00b9b08cb9002732f3ef1;hb=cf4568157972bb2aa3a94603a93266e9272e89b3;hp=7ac022be17447f6c8c21c9eb1cf6a75d2d99e607;hpb=268a74bb051fcbbad532fd833f0d8fd2b33b6c64;p=e-mobility-charging-stations-simulator.git diff --git a/mikro-orm.config-template.ts b/mikro-orm.config-template.ts index 7ac022be..4ef43dff 100644 --- a/mikro-orm.config-template.ts +++ b/mikro-orm.config-template.ts @@ -1,17 +1,17 @@ -import path from 'node:path'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; import { TsMorphMetadataProvider } from '@mikro-orm/reflection'; -import { PerformanceData } from './src/types/orm/entities/PerformanceData'; -import { PerformanceRecord } from './src/types/orm/entities/PerformanceRecord'; -import { Constants } from './src/utils/Constants'; +import { PerformanceData, PerformanceRecord } from './src/types'; +import { Constants } from './src/utils'; export default { metadataProvider: TsMorphMetadataProvider, entities: [PerformanceRecord, PerformanceData], type: 'sqlite', - clientUrl: `file://${path.join( - path.resolve(__dirname), - `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db` + clientUrl: `file://${join( + dirname(fileURLToPath(import.meta.url)), + `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db`, )}`, };