Closed davecardwell closed 4 years ago
Interesting question. Having Graphile Migrate detect GM_DBURL seems sensible... Should this only affect the run
command, I wonder?
As a workaround, you can do:
DATABASE_URL="$GM_DBURL" graphile-migrate run
Incidentally, this is exactly the kind of issue that this was designed to catch.
Thanks, @benjie. DATABASE_URL="$GM_DBURL"
is ultimately what I ended up doing.
Looking through the available commands as they are now it seems graphile-migrate run
is the only one it is relevant to.
@davecardwell What do you think about #86 as a solution?
@benjie Works for me—thanks!
In my
.gmrc
I have anafterCurrent
command specified as{ "_": "command", "command": "yarn seed" }
, which runsgraphile-migrate run
on some .sql files.With the change in 0.3.1 this no longer works because graphile-migrate is setting
GM_DBURL
to the correct value, and then changingDATABASE_URL
topostgres://PLEASE:USE@GM_DBURL/INSTEAD
. This means thatgraphile-migrate run
errors with:I’m not sure what the best solution is here. Should the graphile-migrate CLI be using
GM_DBURL
if it set? IfGM_DBURL
is set andDATABASE_URL
===postgres://PLEASE:USE@GM_DBURL/INSTEAD
? Should I be doing something different?