NestJS TypeORM(^0.2.45) Migration DB 생성 및 첫 Migration진행 -1

위 블로그 글은 TypeORM ^0.2.45버전을 기준으로 작성한 글입니다. npm 설치시 typeorm은 ^0.2.45버전 입니다. // src/db/ormconfig.ts import { TypeOrmModuleOptions } from '@nestjs/typeorm' ; require ( 'dotenv' ). config (); export const typeOrmModuleOptions : TypeOrmModuleOptions = { type : 'postgres' , host : process . env . PG_HOST , port : + process . env . PG_PORT , username : process . env . PG_USERNAME , password : process . env . PG_PASSWORD , database : process . env . PG_DATABASE , autoLoadEntities : true , synchronize : process . env . PG_CHANGE === 'true' , }; export const OrmConfig = { ... typeOrmModuleOptions , migrationsTableName : 'migrations' , entities : [ 'dist/**/*.entity.js' ], migrations : [ 'dist/db/migrations/*.js' ], cli : { migrationsDir : './src/db/migrations' , }, }; export default OrmConfig ; # .env PG_HOST = "localhost" PG_PORT =5434 PG_USERNAME = "a...