X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=mikro-orm.config-template.ts;h=ff08b534e6cba57600073af87f462633bf568285;hb=b2b606263e2676354259164d532ff9aa91ccdf87;hp=5f318c13083b62723b49c0d30cbbfdeee06d11c4;hpb=0d8140bd623b67d6d7fddeda288fd945af0cb168;p=e-mobility-charging-stations-simulator.git diff --git a/mikro-orm.config-template.ts b/mikro-orm.config-template.ts index 5f318c13..ff08b534 100644 --- a/mikro-orm.config-template.ts +++ b/mikro-orm.config-template.ts @@ -1,16 +1,17 @@ -import Constants from './src/utils/Constants'; -import { PerformanceData } from './src/types/orm/entities/PerformanceData'; -import { PerformanceRecord } from './src/types/orm/entities/PerformanceRecord'; +import { dirname, join } from 'node:path'; +import { fileURLToPath } from 'node:url'; + import { TsMorphMetadataProvider } from '@mikro-orm/reflection'; -import { fileURLToPath } from 'url'; -import path from 'path'; + +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(path.dirname(fileURLToPath(import.meta.url))), + clientUrl: `file://${join( + dirname(fileURLToPath(import.meta.url)), `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db` )}`, };