File tree Expand file tree Collapse file tree 2 files changed +9
-11
lines changed
sample/sample1-simple-usage Expand file tree Collapse file tree 2 files changed +9
-11
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,12 @@ import {Post} from "./entity/Post";
6
6
7
7
useContainer ( Container ) ;
8
8
createConnection ( {
9
- driver : {
10
- type : "postgres" ,
11
- host : "localhost" ,
12
- port : 5432 ,
13
- username : "test" ,
14
- password : "admin" ,
15
- database : "test"
16
- } ,
9
+ type : "postgres" ,
10
+ host : "localhost" ,
11
+ port : 5432 ,
12
+ username : "test" ,
13
+ password : "admin" ,
14
+ database : "test" ,
17
15
entities : [
18
16
__dirname + "/entity/*.js"
19
17
] ,
Original file line number Diff line number Diff line change 1
- import { Table , PrimaryColumn , Column } from "typeorm" ;
1
+ import { Entity , PrimaryGeneratedColumn , Column } from "typeorm" ;
2
2
3
- @Table ( )
3
+ @Entity ( )
4
4
export class Post {
5
5
6
- @PrimaryColumn ( "int" , { generated : true } )
6
+ @PrimaryGeneratedColumn ( )
7
7
id : number ;
8
8
9
9
@Column ( )
You can’t perform that action at this time.
0 commit comments