sg migration doesn't use sg.config.yaml to get PG* env vars
Created by: mrnugget
The sg migration
command don't use the PG
(or other) env vars set in sg.config.yaml
.
Why?
sg migration
commands use RawDSNsBySchema
to construct DSNs:
And RawDSNsBySchema
uses os.Getenv
to get config variables:
How to fix
What we would need to do instead is to parseConf
and then pass globalConf.GetEnv
when constructing DSNs, like we do here, for example:
We probably also want a fallback to os.Getenv
in case we can't parse the config file.