Automatically update your codebase to add migrations, entities and subscribers to your data-source.ts
file
npm install --save-dev typescript npm install --save typeorm
typeorm-codebase-sync
npm install --save-dev typeorm-codebase-sync
typeorm-sync
script to package.json
npm set-script "typeorm-sync" "typeorm-codebase-sync addReferences --dataSource ./src/db/data-source.ts --migrations ./src/db/migrations --entities ./src/db/entities --subscribers ./src/db/subscribers"
typeorm-sync
after using the typeorm CLI, edit package.json
:npm set-script "posttypeorm" "npm run typeorm-sync"
DocumentationGiven that your
package.json
contains a script calledtypeorm
, after each time you runnpm run typeorm -- <params>
, thetypeorm-sync
script will automatically run
addReferences
command
Usage: typeorm-codebase-sync addReferences --dataSource <path> [options]
Required:
-d, --dataSource Path to a data-source.ts file [string] [required]
Files:
-m, --migrations Glob of migration files or folders containing migration files [array]
-e, --entities Glob of entity files or folders containing entity files [array]
-s, --subscribers Glob of subscriber files or folders containing subscriber files [array]
Options:
-h, --help Show help [boolean]
-v, --version Show version number [boolean]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4