A long-lived project that still receives updates
RuboCop plugin for ActiveRecord migration.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

 Project Readme

rubocop-migration

ci

RuboCop plugin for ActiveRecord migration.

Usage

Install rubocop-migration gem:

# Gemfile
gem 'rubocop-migration', require: false

then add rubocop-migration to plugins section:

# .rubocop.yml
plugins:
  - rubocop-migration

Migration/AddCheckConstraint:
  Enabled: true

Note that all cops are Enabled: false by default.

Cops

Please read the comments of the respective cop classes for more information.

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.