Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Add migrations_paths option to model generator #33994
Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @eileencodes (or someone else) soon.
If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.
This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.
Please see the contribution instructions for more information.
I'm curious why the user facing API is to pass the migration paths and not the simpler db name?
Perhaps I'm extrapolating from the simple multi db database.yml with the primary database and then the animals.
But wouldn't it be easier to pass
…ors [ci skip] `migrations_paths` option was added to migration generator, with changelog entry, in rails#33760. Also `migrations_paths` option was added to model generator, with changelog entry, in rails#33994. Then `migrations_paths` was renamed to `database` and aliased as `db` in rails#34021, and was added new changelog entry. I think we should edit existed changelog entries instead adding new about changing the name of the option from `migrations_paths` to `database` since Rails 6.0 hasn't been released yet, and since It might confuse readers of the changelog file in case if they've read changelog enty about adding `migrations_paths` option but haven't read the entry about change the name of that option to `database`. @eileencodes, @gmcgibbon, @rafaelfranca Does it make sense?
I would have liked --migrations_paths more. For example discourse plugins live in their own directories without having their own db. https://github.com/discourse/discourse/tree/master/plugins/poll/db/migrate Is there maybe another way to achieve something similar?