Skip to content

Commit

Permalink
update entities syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
pleerock committed Mar 21, 2022
1 parent 85ce932 commit b6f2df3
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/data-source.ts
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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: [],
})

0 comments on commit b6f2df3

Please sign in to comment.