fix: update mikro-orm.config.ts template for version 6
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 13 Jan 2024 14:56:24 +0000 (15:56 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 13 Jan 2024 14:56:24 +0000 (15:56 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
mikro-orm.config-template.ts

index 8b01a42c628da9fe973f87cadbbcd69cf444b126..ddfcb4c338d3570221989e3bf1194ad1389a008d 100644 (file)
@@ -1,17 +1,10 @@
-import { dirname, join } from 'node:path'
-import { fileURLToPath } from 'node:url'
-
-import { TsMorphMetadataProvider } from '@mikro-orm/reflection'
+import { defineConfig } from '@mikro-orm/sqlite'
 
 import { PerformanceData, PerformanceRecord } from './src/types/index.js'
 import { Constants } from './src/utils/index.js'
 
-export default {
-  metadataProvider: TsMorphMetadataProvider,
+export default defineConfig({
+  dbName: `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db`,
   entities: [PerformanceRecord, PerformanceData],
-  type: 'sqlite',
-  clientUrl: `file://${join(
-    dirname(fileURLToPath(import.meta.url)),
-    `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db`
-  )}`
-}
+  debug: true
+})