[openstreetmap/openstreetmap-website] Disable Rails/BulkChangeTable cop (PR #4913)

Andy Allan notifications at github.com
Wed Jun 19 16:59:22 UTC 2024


If you have multiple alter commands in a migration (like adding two columns to an existing table) this cop will suggest combining them using `change_table :foo, :bulk => true`.

However, Strong Migrations can't inspect `change_table` blocks, and therefore suggests using `safety_assured`, which mostly defeats the purpose of using Strong Migrations in the first place.

Instead, we should stick with the individual alter commands. Since postgres runs DDL changes in a transaction anyway, there is not enough benefit from the `change_table` approach to be worth losing the safety net of the Strong Migrations checks.

* Refs https://github.com/ankane/strong_migrations/issues/204
* Refs https://github.com/openstreetmap/openstreetmap-website/pull/4481
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/4913

-- Commit Summary --

  * Disable Rails/BulkChangeTable cop

-- File Changes --

    M .rubocop.yml (4)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/4913.patch
https://github.com/openstreetmap/openstreetmap-website/pull/4913.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/4913
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/4913 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240619/17b8cc42/attachment-0001.htm>


More information about the rails-dev mailing list