-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Description
Issue type:
[x ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[x ] mssql
[ ] mysql / mariadb
[ ] oracle
[ ] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[x ] latest
[ ] @next
[ ] 0.x.x (or put your version here)
While running the yarn ts-node ./node_modules/typeorm/cli.js migration:run facing error
We are using .env file, which has the typeORM configuration.
Configarations we placed
TYPEORM_CONNECTION=mssql
TYPEORM_HOST=localhost
TYPEORM_PORT=1443
TYPEORM_USERNAME=XXXX
TYPEORM_PASSWORD=XXXX
TYPEORM_DATABASE=test
TYPEORM_SYNCHRONIZE=false
TYPEORM_LOGGING=error
TYPEORM_LOGGER=advanced-console
this our script file from here we are running db.migrate

Solutions we tried
[ * ] This is our folder structure placed .env file and ormconfig.json are in same folder but when we are running migrations command it is taking .env file not ormconfig.json

[ * ] We tried to giving yarn ts-node ./node_modules/typeorm/cli.js migration:run -f ormconfig.json but we are unable to compile

[ * ] But by renaming the .env file we are able to compile the command yarn ts-node ./node_modules/typeorm/cli.js migration:run -f ormconfig.json

[ * ] We tried pass our .env file as configuration, it results the same error

[ * ] Checked in the typeorm git repo in that ConnectionOptionsEnvReader() is reading the env variables and in that port is read from port: PlatformTools.getEnvVariable("TYPEORM_PORT"), . getEnvVariables is returning a string.
Which may be causing the issue ?
Please help
Thankyou For advance