From b6f2df3e3b93471ff0aef6d8c9d17d553240b5a0 Mon Sep 17 00:00:00 2001 From: Umed Khudoiberdiev Date: Mon, 21 Mar 2022 20:37:32 +0500 Subject: [PATCH] update entities syntax --- src/data-source.ts | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/data-source.ts b/src/data-source.ts index 1f13d91..2e42394 100644 --- a/src/data-source.ts +++ b/src/data-source.ts @@ -1,5 +1,7 @@ import "reflect-metadata" import { DataSource } from "typeorm" +import { Post } from "./entity/Post" +import { Category } from "./entity/Category" export const AppDataSource = new DataSource({ type: "postgres", @@ -10,12 +12,7 @@ export const AppDataSource = new DataSource({ database: "test", synchronize: true, logging: true, - entities: ["src/entity/*.js"], - subscribers: ["src/subscriber/*.js"], - migrations: ["src/migration/*.js"], - cli: { - entitiesDir: "src/entity", - migrationsDir: "src/migration", - subscribersDir: "src/subscriber", - }, + entities: [Post, Category], + subscribers: [], + migrations: [], })