Skip to content

Add rails db:migrate to Spring-enhanced commands #640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

f1sherman
Copy link

I noticed recently that running bin/rails db:migrate on our app is much slower than bin/rake db:migrate and tracked that down to db:migrate not being a Spring-enhanced command. Given that many Rails developers run this command quite often, possibly more often than some of the other Spring-enhanced commands, it seemed to make sense to add it.

I wasn't sure if I should add all of the db:migrate* tasks (e.g. db:migrate:redo). Since db:migrate probably gets run much more often that those others in many use cases this seems to satisfy the 80/20 rule. I'm happy to add those other commands if that's desired.

I didn't see any test coverage for similar commands, let me know if I should add anything.

Thank you!

I noticed recently that running `bin/rails db:migrate` on our app is
much slower than `bin/rake db:migrate` and tracked that down to
`db:migrate` not being a Spring-enhanced command. Given that many Rails
developers run this command quite often, possibly more often than some
of the other Spring-enhanced commands, it seemed to make sense to add
it.
@kaspth
Copy link
Contributor

kaspth commented Jan 10, 2021

Nice! Since we'd also want this for db:rollback and db:migrate:redo, is it possible to teach Spring to look for bin/rails where it once looked for bin/rake (keeping the bin/rake lookup)? Because it must've had that, and that way we'd get it automatically for all the past enriched commands.

@f1sherman
Copy link
Author

@kaspth great question! I'm sorry but I think I'd need a couple more hours diving in to the source to get a feel for how I might make that change, and I'm not able to commit to that at this time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants