Add config to disable schema dump after migration#13948
Conversation
|
Relevant discussion on the mailing list: https://groups.google.com/forum/#!topic/rubyonrails-core/h4cQXmKuB7M |
activerecord/CHANGELOG.md
Outdated
|
@emilsoman this is looking good. I added a few minor comments about formatting and style. /cc @fxn |
There was a problem hiding this comment.
You should move the blank line to inside the unless clause, so that it doesn't end up with extra blank line when skipping AR.
|
@senny , @carlosantoniodasilva Thanks for the feedback ! Fixed formatting and style issues. Anything else ? |
|
Hey, gonna have a look today. |
|
@emilsoman you will need to squash all your commits into a single one but let's wait for feedback from @fxn first. |
|
Looks good. Just a couple of details. I believe the flag should not appear in test.rb. I explained the rationale in the mailing list but the summary is that since you are not supposed to run migrations in the test environment, it looks strange that the config file says anything about them. The comment is enlightening, see "Do not dump schema after migrations", "in the test environment? which migrations? I am not supposed to run migrations in the test environment!", the user may wonder. Since migrations do not run, the implicit true value is fine, it won't hurt. Then some details regarding the values of the flag. We try to avoid using singletons in docs and tests. As far as the user is concerned this is a flag. We could assign anything to it that is true, and the user can set it to |
activerecord/CHANGELOG.md
Outdated
There was a problem hiding this comment.
I know what you mean by active_record, but by itself doesn't have a lot of meaning. Better to just say "Active Record", those config parameters configure the ORM, "Active Record" is going to be good.
|
@fxn , Thanks for the amazing feedback ! I've removed the config from |
|
@emilsoman sorry for pointing you in the wrong direction with |
|
Exactly :), the idea is that we want to communicate that the default config is such that the schema is not dumped in production. The exact value needed to enable or disable the flag doesn't matter, any value works (interpreted as a flag). |
activerecord/CHANGELOG.md
Outdated
There was a problem hiding this comment.
Please note that "Active Record" has a space in its name, Active Record is an ORM, and ActiveRecord is a Ruby module that generally has little to have documented.
|
I made some editorial comments. Almost there! |
|
@fxn Fixed. Can I squash the commits ? |
There was a problem hiding this comment.
we try to avoid "truthy" and "falsy", "false" is enough
|
Awesome @emilsoman, added a few minor remarks and I think it is good to go. If you revise those and squash we'll apply. |
* Add a config on Active Record named `dump_schema_after_migration` * Schema dump doesn't happen if the config is set to false * Set default value of the config to true * Set config in generated production environment file to false * Update configuration guide * Update CHANGELOG
|
@fxn , done :) |
|
Fantastic! Thanks a lot for working on this 😄 ❤️ |
|
Thanks for guiding this into good shape. You guys were super helpful. Thank you ! |
|
Merged here. |
|
Scott I agree it's generally harmless. It bit us though when we switched from schema to structure, as we rightfully didn't supply pg_dump in our production environments. So grateful for Emil's contribution :) |
* Updated sample database.yml file. * Added sidekiq config file. * Removed rails_12factor gem. Added required config changes for heroku logging. * Removed tagged_logging initializer file. The tagged logging configs are handled separately for each env. * Do not dump schema after migrations. https://groups.google.com/forum/#!topic/rubyonrails-core/h4cQXmKuB7M rails/rails#13948 * Enabled force_ssl config. * Added comments about config/initializers/assets.rb. * reverting some of the changes Co-authored-by: Raj Singh <raj.singh@vineti.com>
dump_schema_after_migration