migrations not run with dotenv file
See original GitHub issueIssue type:
[X] question [ ] bug report [ ] feature request [ ] documentation issue
Database system/driver:
[ ] cordova
[ ] mongodb
[ ] mssql
[ ] mysql
/ mariadb
[ ] oracle
[X] postgres
[ ] cockroachdb
[ ] sqlite
[ ] sqljs
[ ] react-native
[ ] expo
TypeORM version:
[X] latest
[ ] @next
[ ] 0.x.x
(or put your version here)
Steps to reproduce or a small repository showing the problem:
Hello, I’m trying to run migrations. I have a dotenv configuration file for each non-production environment per the dotenv instructions (.env.development, .env.test, etc.). However, when I run migrations I get the error:
Error: No connection options were found in any of configurations file.
I’ve tried explicity setting the file with --config .env.development and I’ve tried leaving things blank. How should I be specifying this file?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7
Top GitHub Comments
i am using migrations with dotenv and it works
I have the same problem. I have a file with typeorm configuration
src/config/typeorm.ts
I couldn’t execute
typeorm migration:run --config dist/src/config/typeorm.js
becausedotenv
doesn’t apply enviroment variables. And it seems--config development.env
or--config .env.development
will not work because the file contains just text wich describe enviroment variables. Please advise how to apply config which uses environment variables.