Database Integrity Validation Skill for Orphaned Orders
Use Claude Code to audit existing data for broken references and other violations before changing constraints.
中文Install in Claude Code
Use a PostgreSQL test copy you control and documented relationship rules. The example uses a read-only query over synthetic customers and orders.
- Get the complete `plugins/database/data-validation-engine/skills/validating-database-integrity` directory from the pinned GitHub commit.
- Copy it into the target project's `.claude/skills/`. Check `.claude/skills/validating-database-integrity/SKILL.md`, start Claude Code at the project root, and call `/validating-database-integrity`.
Example task
Create customer C1 and orders O1, O2, and O3 referencing C1, missing C99, and an allowed NULL respectively. Left join nonempty customer IDs against the customer table.What to check
Only O2 is reported with missing C99. O1 is valid and O3 follows the documented optional relationship.
Original SKILL.md on GitHub · Updated
Frequently asked question
Is checking for a missing parent after a left join enough?
When the relation is optional, distinguish a NULL child key from a nonempty key without a matching parent.