Closed lodi-g closed 2 years ago
Just to challenge the need a little - why can the mocked old data not also be supplied via an afterReset
hook? You can configure it to only run under certain circumstances (e.g. call out to a shell script with whatever logic you need).
Hey @benjie, thanks for your insight and challenging the idea. For some reason, I did not think about that. So I guess the issue is closed, unless there's a use case I didn't think of.
Feature description
I'd like a way to run a reset (with the post reset actions) without running the commited migrations. It could be a command line flag, e.g.
graphile-migrate reset --erase --without-migrations
.Motivating example
My workflow for deploying on pre-production is
Using graphile-migrate this workflow is not possible because running
graphile-migrate reset
will also run the migrations. Therefore, when I try to populate the db using my old data, the data does not adhere to the schema and fails to be populated.Supporting development
I:
It looks like I'd just need to add a CLI flag in the
resetCommand
variable and use it to condition the run of_migrate
(https://github.com/graphile/migrate/blob/main/src/commands/reset.ts#L63). That doesn't look super hard, so if you think this feature request is interesting, I can do it.