From 4b57d244d82d7de9cdcf640c93a3653f7b5c2c63 Mon Sep 17 00:00:00 2001 From: productdevbook Date: Thu, 23 Feb 2023 14:27:07 +0300 Subject: [PATCH] fix: migrator and seedmanager --- package.json | 2 +- src/createMikroORMPostgress.ts | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1993769..416c145 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "@afetcan/storage", "private": false, "type": "module", - "version": "0.0.24", + "version": "0.0.25", "description": "Storage for afetcan.com", "author": "Mehmet - productdevbook ", "license": "MIT", diff --git a/src/createMikroORMPostgress.ts b/src/createMikroORMPostgress.ts index 94c851b..1d13d49 100644 --- a/src/createMikroORMPostgress.ts +++ b/src/createMikroORMPostgress.ts @@ -5,8 +5,11 @@ import { SqlHighlighter } from '@mikro-orm/sql-highlighter' import zod from 'zod' import { config } from 'dotenv' import { diary, enable, error, info } from 'diary' -import { entities } from './entity' + +import { Migrator } from '@mikro-orm/migrations' +import { SeedManager } from '@mikro-orm/seeder' import { DatabaseSeeder } from './seeders/DatabaseSeeder' +import { entities } from './entity' enable('*') @@ -196,6 +199,7 @@ export async function createMikroORMPostgress(config: Config): Promise seeder: { path: join(distPath, 'seeders'), }, + extensions: [Migrator, SeedManager], migrations: { path: join(distPath, 'migrations'), pathTs: join(distPath, 'migrations'),