Skip to content
CAI
Software that uses CAICheck a score

ilyakatz/data-migrate

64.3

Adequate · 19 September 2026

950

lines of production code

Ruby

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

This system is a Ruby gem that extends ActiveRecord to manage data migrations alongside standard schema migrations within Rails applications. It provides Rake tasks and Capistrano integration to execute, track, and roll back data changes in sync with database structure updates. The library supports Rails versions 6.1 through 8.1 and includes generators for creating migration files with customizable templates and paths.

How it got here

2011 — Initial scaffolding and core architecture

8 changes.

This period established the foundational structure of the data\_migrate gem, including repository initialization, dependency configuration, and the core library modules. It introduced essential features such as a customizable data migration generator and a suite of Rake tasks for managing combined schema and data migrations. The work also involved cleaning up legacy Rails scaffolding and updating the codebase to support modern Rails versions.

2016 — Data migration infrastructure and testing

4 changes.

This period focused on implementing conditional data migration capabilities within the Capistrano deployment workflow and establishing a comprehensive RSpec test suite. The work covered validating configuration systems, generator behaviors, and core data migration execution logic to ensure reliability across multiple paths.

2018–2021 — Rails version expansion and task consolidation

4 changes.

The project expanded its compatibility to support Rails versions 6.1 through 8.1 by updating Appraisal configurations. Concurrently, data migration rake tasks were consolidated into a dedicated module to centralize logic and improve version-specific database resolution. Comprehensive test suites were added to verify the new task structure and data migration behaviors.

Features

Initial library structure and core module definition

The library now initializes by loading its core components, including the Rails helper, data migrator, schema migration, database tasks, and configuration modules, and exposes a root path accessor for locating the library directory.

lib · high confidence

Initial project scaffolding and configuration

The repository is initialized with the core structure for the \data\_migrate\ gem, including the MIT license, a comprehensive README detailing installation and usage, and a Changelog tracking versions from 11.3.1 back to 6.0.0. Development tooling is established via \.rubocop.yml\ (targeting Ruby 3.1), \.hound.yml\, \.overcommit.yml\, and an \Appraisals\ file that configures testing against Rails 6.1 through 8.1. The gem's supported Rails versions are explicitly documented as 6.1 through 8.0 in the README, with legacy support for Rails 6.0 via version 9.1.x.

(repo-wide) · high confidence

New data migration generator with customizable templates and paths

The library now includes a dedicated \data\_migration\ generator that creates data migration files using a configurable template and output path. Users can specify custom data migration directories via \data\_migrations\_path\ and provide their own migration templates via \data\_template\_path\. The generated data migrations use the modern \ActiveRecord::Migration\[version\]\ class structure and include a default template that raises \IrreversibleMigration\ in the \down\ method, while a separate standard migration template is also provided for schema changes.

lib/generators · high confidence

New rake tasks for combined schema and data migrations

The \tasks/databases.rake\ file introduces a suite of new Rake tasks that allow users to manage both database schema and data migrations together. Key additions include \db:migrate:with\_data\ to run schema and data migrations in sync, \db:migrate:up:with\_data\ and \db:migrate:down:with\_data\ for version-specific operations, and \db:rollback:with\_data\ for rolling back changes. It also adds \db:migrate:status:with\_data\ to view the status of both migration types, \db:abort\_if\_pending\_migrations\ to prevent deployment with pending changes, and \db:prepare:with\_data\ for initial setup. Additionally, \data:migrate\, \data:migrate:up\, \data:migrate:down\, and \data:migrate:redo\ tasks are provided for managing data migrations independently, ensuring that data schema dumps are updated appropriately after operations.

tasks · high confidence

Removals

Removed legacy Rails scaffolding and framework files

The application's default Rails scaffolding has been removed, including the core configuration files (config/application.rb, config/routes.rb, config/database.yml), the base controller and helper classes, the main layout template, and the public directory assets (error pages, JavaScript libraries like Prototype and script.aculo.us, and the welcome page). This cleanup eliminates the boilerplate code from the initial project setup.

(repo-wide) · high confidence

Behavioural changes

Capistrano deployment now supports conditional data migrations

The deployment process now includes a new Capistrano task that runs \rake db:migrate:with\_data\ instead of the standard migration task. This new behavior is conditional: if the \conditionally\_migrate\ configuration option is enabled, the system checks for changes in both \db/migrate\ and \db/data\ directories and skips the migration step if neither has changed. The task defaults to running on the primary database server and can be configured via \migration\_role\.

lib/capistrano · high confidence

Consolidate data migration tasks into a dedicated module

The rake tasks for data migrations (migrate, status, status\_with\_schema, dump, and abort\_if\_pending\_migrations) are now implemented within the new DataMigrate::Tasks::DataMigrateTasks module. This change centralizes the task logic, ensuring that the status command correctly scans subdirectories for migration files and that the database name resolution adapts to the specific Railties version (Rails 6.1 vs 7.0+).

_lib/data\migrate/tasks · high confidence

DataMigrate v11.3.1: Rails 7.2 compatibility and configuration overhaul

This release updates the gem to version 11.3.1 and introduces significant architectural changes to support Rails 7.2. The library now uses a centralized \DataMigrate.config\ object for settings (such as \data\_migrations\_path\ and \db\_configuration\) instead of global constants, and introduces a \data\_template\_path\ configuration option that validates the existence of custom migration templates. To ensure compatibility with Rails 7.1 and 7.2 internals, the codebase now delegates schema migration access to \ActiveRecord::Base.connection\_pool\ and \connection\ methods, and resets the Active Record model schema cache before running data migrations to prevent stale state issues.

_lib/data\migrate · high confidence

Test coverage

Added comprehensive test suite for data migration configuration and execution; Added test fixtures for data and schema migrations; Added tests for data migration rake tasks; Added tests for the data migration generator; Initial RSpec test suite for data migration paths; Removed obsolete Rails performance and test helper files.

Dependencies

Expanded Rails version support via Appraisal gemfiles

The gemfiles directory now includes Appraisal configurations for Rails 6.1, 7.0, 7.1, 7.2, 8.0, and 8.1, enabling the library to be tested and used across these specific framework versions.

gemfiles · high confidence

Update gem dependencies and simplify Gemfile

The data\_migrate gem now requires Rails 6.1 or higher (activerecord and railties), dropping support for older versions. The Gemfile has been simplified to use the gemspec, removing explicit version constraints for Rails and SQLite3 that were previously defined there.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 64.

Lenses

  • Code Health 99
  • Architecture 69
  • Maturity 57
  • Readiness 65
  • Security 80

Changes since last survey

  • 300 commits — 256 feature/other, 44 fixes

By area

  • (root) — 110 commits
  • (repo) — 73 commits
  • lib/data_migrate — 67 commits
  • spec/data_migrate — 17 commits
  • .github/workflows — 12 commits
  • tasks/databases.rake — 8 commits
  • spec/db — 4 commits
  • gemfiles/rails_6.1.gemfile.lock — 3 commits
  • lib/generators — 2 commits
  • gemfiles/rails_5.0.gemfile — 1 commit
  • gemfiles/rails_7.1.0.alpha.gemfile.lock — 1 commit
  • gemfiles/rails_7.1.gemfile — 1 commit
  • lib/data_migrate.rb — 1 commit

Notable commits

  • fix: Avoid monkey patching methods provided by Rails Also coincidentally fixes the rails 7.2 connection pool deprecation warning
  • fix: Bump version for hotfix
  • fix: Fix #220
  • fix: Fix DataMigrator#match regex
  • fix: Fix current data version lookup in db:migrate:with_data
  • fix: Fix data:schema:load for structure.sql
  • fix: Fix db configurations hash access deprecation
  • fix: Fix db configurations hash access deprecation
  • fix: Fix db_config_with_versions arity change and backport
  • fix: Fix for Rails 6.1
  • fix: Fix spec
  • fix: Fix specs
  • fix: Fix status and status:with_data rake tasks
  • fix: Fix tests
  • fix: Fix version check
  • fix: Fix wrong module class was called
  • fix: Merge pull request #141 from ilyakatz/fix-gem-push
  • fix: Merge pull request #169 from ilyakatz/NejRemeslnici-fix-configs-for-deprecation
  • fix: Merge pull request #175 from ilyakatz/NejRemeslnici-fix-configs-for-deprecation-6-1
  • fix: Merge pull request #229 from ilyakatz/foxondo-fix-eager-schema-migration
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

ilyakatz/data-migrate was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 19 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 1be18a2d0f0a53d967e9d3853da2e9cc3f29400d — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.