braintree / pg_ha_migrations

Enforces DDL/migration safety in Ruby on Rails project with an emphasis on explicitly choosing trade-offs and avoiding unnecessary magic.
MIT License
220 stars 23 forks source link

Enforce certain safety features even in unsafe_* by default #63

Open jcoleman opened 3 years ago

jcoleman commented 3 years ago

From discussion in #22:

...it might well be the case that all of the unsafe variants (where it's relevant) should use the safe lock acquisition. I think that's mostly a project policy discussion, since it means the unsafe variants are increasingly not just proxies for the original Rails method (though we've already gone down that path somewhat with the dependent object checks).

ISTM that what we might want here is to move from 2 layers (safe_* and unsafe_*) to 3 layers: safe_*, unsafe_* to prevent clear database level issues (e.g., provide safe locking), and insert a new layer (maybe raw_*?) to be a pure dispatch into the original ActiveRecord implementation.