Skip to content

Commit

Permalink
fix: migration path and MikroORM config
Browse files Browse the repository at this point in the history
  • Loading branch information
Bastien Gatellier committed Jul 2, 2023
1 parent 47196e1 commit 41ce280
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ const DB_NAME = "heart"
export function createDatabaseConfig<D extends IDatabaseDriver>(
defineConfig: (o: Options<D>) => Options<D>,
databaseUrl: string,
migationsOptions: Pick<MigrationsOptions, "path" | "pathTs">
migrationsOptions: Pick<MigrationsOptions, "path" | "pathTs">
): Options<D> {
return defineConfig({
clientUrl: databaseUrl,
dbName: DB_NAME,
entities: [ReportEntity, ServiceEntity],
metadataProvider: TsMorphMetadataProvider,
migrations: {
path: migationsOptions.path,
pathTs: migationsOptions.pathTs,
path: migrationsOptions.path,
pathTs: migrationsOptions.pathTs,
},
name: DB_NAME,
})
}
4 changes: 2 additions & 2 deletions modules/mysql/src/config/mikro-orm.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ import { createDatabaseConfig } from "@fabernovel/heart-common"
import { env } from "node:process"

export default createDatabaseConfig<MySqlDriver>(defineConfig, env.HEART_MYSQL_URL as string, {
path: "../lib/migrations",
pathTs: "./migrations",
path: "lib/migrations",
pathTs: "src/migrations",
})

0 comments on commit 41ce280

Please sign in to comment.