File tree Expand file tree Collapse file tree 4 files changed +3
-29
lines changed
Expand file tree Collapse file tree 4 files changed +3
-29
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,6 @@ typings/
2020
2121# Dist #
2222dist /
23- ormconfig.json
2423tsconfig.build.json
2524
2625# IDE #
Original file line number Diff line number Diff line change @@ -228,7 +228,6 @@ The swagger and the monitor route can be altered in the `.env` file.
228228| ** test/unit/** * .test.ts | Unit tests |
229229| .env.example | Environment configurations |
230230| .env.test | Test environment configurations |
231- | ormconfig.json | TypeORM configuration for the database. Used by seeds and the migration. (generated file) |
232231| mydb.sql | SQLite database for integration tests. Ignored by git and only available after integration tests |
233232
234233![ divider] ( ./w3tec-divider.png )
@@ -390,7 +389,6 @@ npm start db.seed
390389| ` npm start " db.seed -L" ` | Log database queries to the terminal |
391390| ` npm start " db.seed --factories <path>" ` | Add a different path to your factories (Default: ` src / database / ` ) |
392391| ` npm start " db.seed --seeds <path>" ` | Add a different path to your seeds (Default: ` src / database / seeds / ` ) |
393- | ` npm start " db.seed --config <file>" ` | Path to your ormconfig.json file |
394392
395393
396394
Original file line number Diff line number Diff line change 11import * as Chalk from 'chalk' ;
22import * as commander from 'commander' ;
33import * as path from 'path' ;
4+ import { createConnection , getConnectionOptions } from 'typeorm' ;
45
56import { loadEntityFactories } from './' ;
6- import { getConnection } from './connection' ;
77import { loadSeeds } from './importer' ;
88import { runSeed , setConnection } from './index' ;
99
@@ -60,7 +60,8 @@ const run = async () => {
6060 // Get database connection and pass it to the seeder
6161 let connection ;
6262 try {
63- connection = await getConnection ( ) ;
63+ const connectionOptions = await getConnectionOptions ( ) ;
64+ connection = await createConnection ( connectionOptions ) ;
6465 setConnection ( connection ) ;
6566 } catch ( error ) {
6667 return handleError ( error ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments