# djezzzl/database_consistency

The tool to avoid various issues due to inconsistencies and inefficiencies between a database schema and application models.

Repository: https://github.com/djezzzl/database_consistency
Canonical: https://ross.abutalabs.com/products/database_consistency
Language: Ruby
License: MIT
License Family: permissive
Topics: ruby-on-rails, activerecord, tool, database, consistency, optimization, performance, rails, ruby
Last push: 2026-08-24T04:25:52+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 2864, "days_push": 9, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1192, forks 65 (observed 2026-08-28T04:03:56.381455+00:00)

## What it is
A Ruby gem that audits Rails ActiveRecord models against the database schema to detect inconsistencies and inefficiencies. It reports missing constraints, validations, indexes, foreign keys, and other schema-model mismatches.

## Use cases
- find missing null constraints between rails models and database schema
- detect missing unique indexes for uniqueness validations
- check foreign keys for belongs_to associations
- find redundant indexes in a rails database
- audit enum values mismatch between database and activerecord
- verify primary key and foreign key type consistency
- catch missing presence validations for non-null columns

## When to choose
- you maintain a Ruby on Rails app with ActiveRecord and want to catch schema/model drift
- you want to enforce database-level constraints matching model validations in CI
- you need to find missing or redundant indexes to improve query performance

## When to avoid
- your project does not use Ruby on Rails or ActiveRecord
- you need a general-purpose database migration or schema design tool rather than a consistency checker

## Facets
- artifact type: cli-tool
- maturity: active
- function: database, developer-tools, linter
- domain: databases, developer-tools, web-development
- platform: ruby, cli
- tags: activerecord, ruby-on-rails, schema-consistency, static-analysis, database-linter

## Member repositories
- djezzzl/database_consistency (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:56.381455+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:22:28.839059+00:00, confidence not recorded.
  - readme: https://github.com/djezzzl/database_consistency (fetched 2026-08-28T04:03:56.381455+00:00, sha 68c81fc3f26b)
- Data as of 2026-08-30T08:39:29.467469+00:00.
