No metadata for "env_setting" was found
Troubleshooting the “No Metadata Was Found” Error in TypeORM
TypeORM is a popular Object-Relational Mapping (ORM) library for TypeScript and JavaScript, widely used to interact with databases…
medium.com
여러 이유로 entity와 DB가 연결이 느슨해지면 나는 문제다. 메타데이터를 읽어오지 못해서 나는 문제인데, 나의 경우는
파일명 때문에 난 에러였다.
파일명.entity.ts 로 파일명을 설정해줘야 이 파일을 entity로 인식한다.
.entity.ts 파일을 자동으로 typeorm 파일로 색인하고 처리하기 때문이다.
관련 내용 )
In TypeORM, the convention for naming entity files is crucial for automatic discovery and metadata creation. TypeORM relies on naming conventions to find and load entities from your project.
The convention is as follows: Entity files should end with .entity.ts for TypeORM to automatically recognize them. This is part of the automatic entity discovery mechanism provided by TypeORM.
When you name your entity file with the .entity.ts suffix, TypeORM scans your project directory for files that match this pattern, loads them, and creates metadata for the entities defined in those files. The metadata includes information about the database table, columns, relationships, and more.
If you deviate from this naming convention (for example, naming your entity file as name.ts without the .entity suffix), TypeORM might not be able to recognize it during the automatic discovery process. As a result, the metadata for that entity may not be generated, and the entity might not be properly registered with TypeORM.