Skip to content

Commit 24ffb52

Browse files
committed
Update dependencies and fix config
Directly taken from @Urigo's fix on typeorm/typescript-example
1 parent 1322e26 commit 24ffb52

File tree

5 files changed

+22
-24
lines changed

5 files changed

+22
-24
lines changed

ormconfig.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
[
22
{
33
"name": "default",
4-
"driver": {
5-
"type": "mysql",
6-
"host": "localhost",
7-
"port": 3306,
8-
"username": "test",
9-
"password": "test",
10-
"database": "test"
11-
},
4+
"type": "mysql",
5+
"host": "localhost",
6+
"port": 3306,
7+
"username": "test",
8+
"password": "test",
9+
"database": "test",
1210
"autoSchemaSync": true,
1311
"entities": [
1412
"src/entity/*.js"

package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@
2424
"typeorm-express-example"
2525
],
2626
"devDependencies": {
27-
"typescript": "^2.1.5"
27+
"typescript": "^2.4.2"
2828
},
2929
"dependencies": {
30-
"@types/body-parser": "^1.16.0",
31-
"express": "^4.15.2",
32-
"@types/express": "^4.0.35",
33-
"@types/node": "^7.0.4",
34-
"body-parser": "^1.17.1",
35-
"mysql": "^2.12.0",
36-
"reflect-metadata": "^0.1.9",
37-
"typeorm": "0.0.9"
30+
"@types/body-parser": "^1.16.4",
31+
"express": "^4.15.4",
32+
"@types/express": "^4.0.36",
33+
"@types/node": "^8.0.24",
34+
"body-parser": "^1.17.2",
35+
"mysql": "^2.14.1",
36+
"reflect-metadata": "^0.1.10",
37+
"typeorm": "0.1.0-alpha.35"
3838
},
3939
"scripts": {
4040
"start": "tsc && node src/index.js"

src/entity/Category.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import {Table, PrimaryColumn, Column} from "typeorm";
1+
import {Entity, PrimaryGeneratedColumn, Column} from "typeorm";
22

3-
@Table()
3+
@Entity()
44
export class Category {
55

6-
@PrimaryColumn("int", { generated: true })
6+
@PrimaryGeneratedColumn()
77
id: number;
88

99
@Column()

src/entity/Post.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import {Table, PrimaryColumn, Column, ManyToMany, JoinTable} from "typeorm";
1+
import {Entity, PrimaryGeneratedColumn, Column, ManyToMany, JoinTable} from "typeorm";
22
import {Category} from "./Category";
33

4-
@Table()
4+
@Entity()
55
export class Post {
66

7-
@PrimaryColumn("int", { generated: true })
7+
@PrimaryGeneratedColumn()
88
id: number;
99

1010
@Column()

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"version": "2.0.2",
2+
"version": "2.4.2",
33
"compilerOptions": {
44
"lib": ["es5", "es6"],
55
"target": "es6",

0 commit comments

Comments
 (0)