Skip to content

Commit b6f2df3

Browse files
committed
update entities syntax
1 parent 85ce932 commit b6f2df3

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

src/data-source.ts

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import "reflect-metadata"
22
import { DataSource } from "typeorm"
3+
import { Post } from "./entity/Post"
4+
import { Category } from "./entity/Category"
35

46
export const AppDataSource = new DataSource({
57
type: "postgres",
@@ -10,12 +12,7 @@ export const AppDataSource = new DataSource({
1012
database: "test",
1113
synchronize: true,
1214
logging: true,
13-
entities: ["src/entity/*.js"],
14-
subscribers: ["src/subscriber/*.js"],
15-
migrations: ["src/migration/*.js"],
16-
cli: {
17-
entitiesDir: "src/entity",
18-
migrationsDir: "src/migration",
19-
subscribersDir: "src/subscriber",
20-
},
15+
entities: [Post, Category],
16+
subscribers: [],
17+
migrations: [],
2118
})

0 commit comments

Comments
 (0)