Restore Schema Dumper behavior changed by #2019#2047
Merged
koic merged 1 commit intorsim:masterfrom Sep 11, 2020
Merged
Conversation
koic
reviewed
Sep 10, 2020
| private | ||
| def column_spec_for_primary_key(column) | ||
| spec = super | ||
| spec.except!(:precision) if prepare_column_options(column) == { precision: "38", null: "false" } |
Collaborator
There was a problem hiding this comment.
I'm not sure if the comparison with the hash object is the best way, but the dumped source has been fixed.
I have a one point. I think that the hash object instantiation can be reduced by making the hash object to be a constant.
This pull request restores Schema Dumper behavior changed by rsim#2019 because rails/rails#39365 does not intend to dump the default primary key configuration. To avoid hash creation every time, it has been frozen and saved as a constant. Related to rails/rails#39365 Follow up rsim#2019 Refer http://code.jeremyevans.net/presentations/rubykaigi2019/index.html#58
Collaborator
Author
|
Thanks for the review. Updated to save the frozen hash as a constant. |
koic
approved these changes
Sep 11, 2020
Collaborator
koic
left a comment
There was a problem hiding this comment.
Thank you for removing weird dumped table option!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request restores Schema Dumper behavior changed by #2019
because rails/rails#39365 does not intend to dump the default primary key configuration.
Related to rails/rails#39365
Follow up #2019