schema-drift-detector

Detect unrelated schema.rb changes in pull requests against database migrations.

Updated Jun 28, 2022
One-click install
npx skills add https://github.com/pcasaretto/nix-home --skill schema-drift-detector-pcasaretto
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: schema-drift-detector
Source: https://github.com/pcasaretto/nix-home/tree/main/home-manager/modules/common/pi/compound-engineering/skills/schema-drift-detector
Command: npx skills add https://github.com/pcasaretto/nix-home --skill schema-drift-detector-pcasaretto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill prevents accidental inclusion of unrelated database schema changes in pull requests, which can lead to merge conflicts and confusion.

Core Features & Use Cases

  • Identifies schema changes: Compares schema.rb against migrations within a pull request.
  • Flags unrelated modifications: Detects extra columns, tables, indexes, or version mismatches not present in the PR's migrations.
  • Use Case: When reviewing a pull request that includes database migrations, use this Skill to ensure that the schema.rb file only reflects the changes intended by the PR, not accidental updates from other branches.

Quick Start

Use the schema-drift-detector to verify that the schema.rb changes in this PR are only related to the included migrations.

Frequently Asked Questions about schema-drift-detector

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect unrelated schema.rb changes in a pull request?

Detect schema.rb drift in a pull request by cross-referencing the file against included database migrations to identify extra columns, tables, indexes, or version mismatches not present in the PR's migrations.

What is schema drift in database migrations and why does it cause merge conflicts?

Schema drift occurs when a schema.rb file contains unrelated database changes from other branches. Detecting it before merging prevents accidental inclusions that lead to merge conflicts and confusion.

How do I check if schema.rb only reflects changes from my PR's migrations?

Verify schema integrity by comparing the schema.rb file against database migrations included in the pull request. The detector flags extra columns, tables, indexes, and version mismatches not covered by those migrations.

Can I flag extra columns and indexes in schema.rb that are not in my pull request migrations?

Yes, the drift detector flags extra columns, tables, indexes, and version mismatches by cross-referencing schema.rb changes against the database migrations included within the specific pull request.

Do I need any external dependencies to run schema drift detection on my code review?

No external dependencies are required. The schema drift detector runs as a standalone script with reference components, comparing schema.rb against migrations to ensure schema integrity before merging code.

When should I run drift detection during a pull request code review?

Run drift detection when reviewing a pull request that includes database migrations. It ensures the schema.rb file only reflects intended changes, preventing accidental updates from other branches before merging.