File tree 5 files changed +13
-7
lines changed
5 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ TYPEORM_MIGRATIONS_DIR=src/migrations
10
10
TYPEORM_ENTITIES = src/entities/*.ts
11
11
TYPEORM_ENTITIES_DIR = src/entities
12
12
TYPEORM_SUBSCRIBERS_DIR = src/subscribers
13
+ TYPEORM_SUBSCRIBERS = src/subscribers/*.ts
13
14
TYPEORM_SEEDING_FACTORIES = src/services/db/factories/**/*{.ts,.js}
14
15
TYPEORM_SEEDING_SEEDS = src/services/db/seeders/**/*{.ts,.js}
15
16
TYPEORM_LOGGING = true
Original file line number Diff line number Diff line change @@ -23,7 +23,8 @@ Following software is required to be installed to use this repo:
23
23
- ` yarn install ` - will run and configure everything for you
24
24
25
25
#### Database
26
- - use ` yarn db:migration:new -n <class name> ` to generate new migration file (same goes for entity and subscriber)
26
+ - use ` yarn db:migration:new <class name> ` to generate new empty migration file (same goes for entity and subscriber)
27
+ - use ` docker-compose exec backend yarn db:migration:generate <class name> ` to generate new auto generated migration
27
28
- ` yarn db:migrate ` - runs all pending migrations against database
28
29
- ` yarn db:revert ` - reverts last migration, run multiple times to revert everything
29
30
- ` yarn db:seed ` - seeds database with fake data (` src/services/db/seeders ` )
Original file line number Diff line number Diff line change 10
10
"scripts" : {
11
11
"start:dev" : " npx task dev" ,
12
12
"db:migration:new" : " yarn run typeorm-ts migration:create -n " ,
13
+ "db:migration:generate" : " yarn run typeorm-ts migration:create -n " ,
13
14
"db:entity:new" : " yarn run typeorm-ts entity:create -n " ,
14
15
"db:subscriber:new" : " yarn run typeorm-ts subscriber:create -n " ,
15
16
"db:migrate" : " npx task npm typeorm-ts migration:run" ,
32
33
"typeorm-ts" : " ts-node ./node_modules/typeorm/cli.js" ,
33
34
"seeder" : " ts-node ./node_modules/typeorm-seeding/dist/cli.js" ,
34
35
"start:server" : " node --inspect=0.0.0.0:56745 -r ts-node/register -r dotenv/config src/index.ts" ,
35
- "nodemon" : " ./node_modules/nodemon/bin/nodemon.js"
36
+ "NODE_ENV=development nodemon" : " ./node_modules/nodemon/bin/nodemon.js"
36
37
},
37
38
"dependencies" : {
38
39
"fastify" : " ^2.13.0" ,
Original file line number Diff line number Diff line change @@ -51,8 +51,9 @@ export class App {
51
51
} ) ;
52
52
}
53
53
54
- public async stop ( ) : Promise < void > {
54
+ public async stop ( signal : string ) : Promise < void > {
55
55
await this . instance . close ( ) ;
56
+ process . kill ( process . pid , signal ) ;
56
57
}
57
58
58
59
private registerPlugins ( ) : void {
@@ -88,4 +89,4 @@ declare module "fastify" {
88
89
config : Config ;
89
90
db : Connection ;
90
91
}
91
- }
92
+ }
Original file line number Diff line number Diff line change @@ -3,8 +3,10 @@ import nodeCleanup from "node-cleanup";
3
3
4
4
const app = new App ( ) ;
5
5
6
- nodeCleanup ( function ( ) {
7
- app . stop ( ) ;
6
+ nodeCleanup ( function ( exitCode , signal ) {
7
+ app . stop ( signal as string ) ;
8
+ nodeCleanup . uninstall ( ) ;
9
+ return false ;
8
10
} ) ;
9
11
10
- app . start ( ) ;
12
+ app . start ( ) ;
You can’t perform that action at this time.
0 commit comments