We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
1. entity => DB 테이블 생성
[ config/configuration.[local/development/production].ts ] database: { mysqlDb: { ... entities: ['dist/**/entities/*.entity{.ts,.js}'], // entity 인식 ... synchronize: true // 개발 초기에만 true로 사용하되, false로 변경 필요 }, oracleDb: { ... } }
[ app.module.ts ] imports: [ ConfigModule.forRoot({ isGlobal: true, cache: true, load: [ configuration ] }), /* TypeOrm 설정 */ TypeOrmModule.forRootAsync({ imports: [ConfigModule], useFactory: (configService: ConfigService) => configService.get('database.mysqlDb'), inject: [ConfigService] }), ... ],
2. DB => entity 생성
$ npm i typeorm-model-generator
$ cd /폴더명 ex) cd /d/www/project
$ npm typeorm-model-generator -h 호스트명 -d DB명 -p 포트명 -u DB유저명 -x DB유저패스워드 -e 엔진,DB종류명 -o entity파일 생성할 폴더 경로명 $ npx typeorm-model-generator -h 호스트명 -d DB명 -p 포트명 -u DB유저명 -x DB유저패스워드 -e 엔진,DB종류명 -o entity파일 생성할 폴더 경로명 // 위에 npm 안될 경우 npx로 시도 ex) npx typeorm-model-generator -h 127.0.0.1 -d test -p 3306 -u root -x password -e mysql -o ./src/migrations ex) npx typeorm-model-generator -h rds-an2-test-dev-oracle.ap-northeast-2.rds.amazonaws.com -d test -p 1521 -u root -x password -e oracle -o ./src/migrations
참고한 사이트 : https://anywaydevlog.tistory.com/40
The text was updated successfully, but these errors were encountered:
No branches or pull requests
1. entity => DB 테이블 생성
2. DB => entity 생성
참고한 사이트 : https://anywaydevlog.tistory.com/40
The text was updated successfully, but these errors were encountered: