The main idea is to connect 3 tables using typeorm. 2 of them work properly in the beginning:
module.exports = {
"type": "mssql",
"host": "xxx",
"port": 1433,
"username": "xxx",
"password": "xxx",
"database": "xxx",
"entities": [
"build/models/**/*.js"
]}
The problem is when I try to connect the third table, that uses the others as "ManyToOne". Then I get this error:
UnhandledPromiseRejectionWarning: Error: Entity metadata for Result#RES_ControllerId was not found. Check if you specified a correct entity object and if it's connected in the connection options.
I solve this problem adding "__dirname" to entities.
module.exports = {
"type": "mssql",
"host": "xxx",
"port": 1433,
"username": "xxx",
"password": "xxx",
"database": "xxx",
"entities": [
__dirname + "build/models/**/*.js" <------ Here
]
}
Then the error changes to:
No repository for "Tabla1" was found. Looks like this entity is not registered in current "default" connection?
No repository for "Tabla2" was found. Looks like this entity is not registered in current "default" connection?
I´m stunk here and I don´t know how to continue with my program, there is no problem if you need something else. Thanks in advance.