rubocop-migration
RuboCop plugin for ActiveRecord migration.
Usage
Install rubocop-migration gem:
# Gemfile
gem 'rubocop-migration'then add rubocop-migration to plugins section:
# .rubocop.yml
plugins:
  - rubocop-migration
Migration/AddCheckConstraint:
  Enabled: trueNote that all cops are Enabled: false by default.
Cops
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
 
Acknowledgements
This gem was heavily inspired by ankane/strong_migrations.
The gem rubocop-migration was originally developed at wealthsimple/rubocop-migration, and later the gem name was transferred to this repository.
Some cops were originally created at r7kamura/sevencop then moved to this repository.