Add post migration cop to prevent schema additions
What does this MR do and why?
Describe in detail what your merge request does and why.
This MR does two things:
-
Defines a new rubocop migration cop helper to allow us to define an "enforced since" parameter. This allows us to lint old migrations and ignore the cop, but check all migrations going forward.
-
Adds a new cop to check for schema addition methods in new post migrations.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
git checkout 378637-new-schema-rubocop
- Add post deployment migration that uses the
add column
method - bundle exec rubocop (it should fail)
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #378637 (closed)