schema_reaper reads your live PostgreSQL schema and planner statistics and cross-references them against a Prism-AST static scan of your codebase (models, views, SQL string literals). With an optional runtime signal -- a sampled log of which columns are actually read in production -- it fuses static and runtime evidence into a confidence score per finding. Analyzers: * dead_column -- column no code path references * dead_table -- table with no model/query reference, zero rows * unused_index -- non-unique index, idx_scan = 0 in pg_stat * duplicate_index -- index that is a prefix of a wider index * missing_fk_index -- foreign-key / *_id column with no covering index * always_null_column -- pg_stats null_frac = 1.0, carries no data * single_value_column -- one distinct value across a large table Every finding carries a reclaimable-bytes estimate (from row counts) and a concrete fix. `generate-migration` emits a staged, reversible pair: ignored_columns first, remove_column after a soak. Nothing is dropped automatically. Columns owned by common gems (devise, paper_trail, activestorage, actiontext, friendly_id, audited, pg_search, ahoy_matey, paranoia) are whitelisted when the gem is in your bundle. Reporters: table, json, markdown (PR comments), SARIF 2.1.0 (GitHub code scanning). `scan --ci` gates only findings absent from a committed baseline. `trend` keeps an append-only history log for cleanup burndown. A Rails railtie adds rake tasks and an opt-in runtime tracker. Custom analyzers load through the `require:` config key. PostgreSQL only for now (MySQL adapter on the roadmap). Ruby >= 2.7.
Required Ruby Version
>= 2.7.0
Authors
aksshatt
Versions
- 1.0.15 September 18, 2026 (51 KB)
- 1.0.14 September 18, 2026 (49 KB)
- 1.0.13 September 18, 2026 (47.5 KB)
- 1.0.12 September 15, 2026 (46 KB)
- 1.0.11 September 15, 2026 (45 KB)
- 1.0.3 September 04, 2026 (29.5 KB)