RuboCop extension focused on ActiveRecord migration.
Install rubocop-migration
gem:
This gem is not yet published to rubygems.org. See #1 for more details.
# Gemfile
gem 'rubocop-migration', require: false, github: 'r7kamura/rubocop-migration', branch: 'main'
then require rubocop-migration
and enable the cops you want to use in your .rubocop.yml:
# .rubocop.yml
require:
- rubocop-migration
Migration/AddCheckConstraint:
Enabled: false
Note that all cops are Enabled: false
by default.
Please read the comments of the respective cop classes for more information.
- Migration/AddCheckConstraint
- Migration/AddColumnWithDefaultValue
- Migration/AddForeignKey
- Migration/AddIndexColumnsCount
- Migration/AddIndexConcurrently
- Migration/AddIndexDuplicate
- Migration/BatchInBatches
- Migration/BatchInTransaction
- Migration/BatchWithThrottling
- Migration/ChangeColumn
- Migration/ChangeColumnNull
- Migration/CreateTableForce
- Migration/Jsonb
- Migration/RemoveColumn
- Migration/RenameColumn
- Migration/RenameTable
- Migration/ReservedWordMysql
This gem was heavily inspired by the following gem: