db-migrate / node-db-migrate

Database migration framework for node
Other
2.32k stars 360 forks source link

Config: Allow default value for when environment variables not set #765

Open kael-shipman opened 2 years ago

kael-shipman commented 2 years ago

I'm submitting a...

Current behavior

You can specify environment variables for config, but if the environment variable is not set, you can't provide a default (fallback) value.

Expected behavior

Should be able to provide { "ENV": "MY_ENV_VAR", "default": "some-value" } as a value, and when MY_ENV_VAR is not set, some-value should be used.

Environment


db-migrate version: 0.11.13
db-migrate driver with versions: mysql v2.2.0

Additional information:
- Node version: v17.3.0
- Platform: Linux (Ubuntu 20.04.3)