Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Automatically update your codebase to add migrations, entities and subscribers to your `data-source.ts` file

NotificationsYou must be signed in to change notification settings

giladgd/typeorm-codebase-sync

Repository files navigation

Automatically update your codebase to add migrations, entities and subscribers to yourdata-source.ts file

TestVersioncodecov

Installation

  1. Install dependencies
npm install --save-dev typescriptnpm install --save typeorm
  1. Installtypeorm-codebase-sync
npm install --save-dev typeorm-codebase-sync
  1. Addtypeorm-sync script topackage.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"
  1. To automatically runtypeorm-sync after using the typeorm CLI, editpackage.json:
npm set-script"posttypeorm""npm run typeorm-sync"

Given that yourpackage.json contains a script calledtypeorm,after each time you runnpm run typeorm -- <params>, thetypeorm-sync script will automatically run

Documentation

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]

About

Automatically update your codebase to add migrations, entities and subscribers to your `data-source.ts` file

Topics

Resources

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2025 Movatter.jp