This patch addresses, in my opinion, a transitive defect in buffalo, and while we could probably patch buffalo I believe this fix would be helpful for all downstream customers of envy. I might be completely wrong about this, I'm just trying to help and learn.
Currently, by default buffalo task db:seed operates on the test environment, and thus the test database. That's odd to me because the default models.go indicates the intention that development should be the default environment with the following snippet of code:
With this patch we will continue to verify the existence of the flag test.v, but now we'll also verify that it is set to true before setting GO_ENV to test.
How to Reproduce
Env
$ go version
go version go1.10.2 darwin/amd64
$ buffalo version
INFO[0000] Buffalo version is: v0.11.1
Perceived Issue
This patch addresses, in my opinion, a transitive defect in
buffalo
, and while we could probably patchbuffalo
I believe this fix would be helpful for all downstream customers ofenvy
. I might be completely wrong about this, I'm just trying to help and learn.Currently, by default
buffalo task db:seed
operates on thetest
environment, and thus thetest
database. That's odd to me because the defaultmodels.go
indicates the intention thatdevelopment
should be the default environment with the following snippet of code:With this patch we will continue to verify the existence of the flag
test.v
, but now we'll also verify that it is set totrue
before settingGO_ENV
totest
.How to Reproduce
Env
Steps
Add this to the
seed
grift:Then run the task: