Possible bug around db:reset
Apologies in advance if I missed something in the docs, but I didn't see anything about this in the readme or an existing bug:
I would expect db:reset to run the data:schema:load task. When we do a reset the data:version task returns 0 and all our migrations show as down.
Is this intentional behavior (in which case I'd be happy to start a PR around some docs), or a bug?
Unfortunately, the db:reset is part of the Rails tasks, so it only knows about Rails stuff. So it'll only run db:schema:load because it doesn't know about the data-migration gem. You would have to create a different rake task to include data:schema:load or maybe a way to alias them
I think a viable solution is to enhance the db:setup task:
Rake::Task["db:setup"].enhance do
Rake::Task["data:schema:load"].invoke
end
However I also found that the data:schema:load messes up the DB environment somehow, and it prevents running db:reset again afterwards. This can be fixed by also invoking db:environment:set after data:schema:load.
It would be nice if the library set this up out of the box though.