Open gudatcomputers opened 6 years ago
Actually I think the 'DATABASE_URL'
is totally ignored. I wanted to use it to override my database.json
but cannot get it to work.
I will check that back thanks for reporting. Environment variables should be always favoured before anything else.
I run into similar problem with mongodb url, escaping connection string by double quotes worked for me. export DATABASE_URL="..."
I have a PR out for this, but there is also a work-around.
@Levino my case sounded a lot like yours.
In your database.json you do the following:
{ "heroku": { "ENV": "DATABASE_URL" } }
Then run the migrate command with --env heroku
it should work.
I'm submitting a...
Current behavior
running
db-migrate
withDATABASE_URL
defined does not ignoredefaultEnv
from.db-migraterc
Expected behavior
running
db-migrate
withDATABASE_URL
respects that value and doesn't try to readdefaultEnv
from.db-migraterc
Minimal reproduction of the problem with instructions
export DATABASE_URL=mysql://<some-valid-connection-string>
.db-migraterc
with adefaultEnv
configured. I chose local instead of dev for my example.db-migrate
.What is the motivation / use case for changing the behavior?
When setting database URL, the intent is that it is defining everything about your environment. To respect the
defaultEnv
setting from.db-migraterc
seems to contradict thatEnvironment