annotate_models icon indicating copy to clipboard operation
annotate_models copied to clipboard

Various formats of pg_dump cause many changes in git pull requests, when no real change is made

Open dhempy opened this issue 6 years ago • 0 comments

Our team of developers have various version of postgres installed locally, for good reasons. They produce different pg_dump formatting, which yields huge and misleading diff's in git and in pull requests.

For example, the spacing here:

- #  index_driver_on_member_number  (member_number)
- #  index_driver_on_member_status  (member_status)
- #  index_driver_on_last_name  (last_name)
+ #  index_driver_on_member_number          (member_number)
+ #  index_driver_on_member_status          (member_status)
+ #  index_driver_on_last_name               (last_name)

...and the string length modifier here:

- #  created_at                             :datetime         not null
- #  updated_at                             :datetime         not null
- #  regex_pattern_severity                 :string(255)      default("warning")
- #  error_message                          :string(255)
+ #  created_at                             :datetime
+ #  updated_at                             :datetime
+ #  regex_pattern_severity                 :string           default("warning")
+ #  error_message                          :string

This can lead to pull requests with HUNDREDS of files showing trivial changes like this, if a new developer runs many old migrations and commits.

Is there some combination of annotate parameters that would help alleviate this? Even if it meant a loss of detail, that would let us keep using annotate. As it is, it is too cumbersome in pull requests to justify it our larger projects.

Version

annotate (2.6.5) Rails 4.2.9 ruby 2.1.9p490

dhempy avatar Nov 19 '18 22:11 dhempy