db-referential-integrity

Audit foreign key constraints in relational databases for integrity issues.

18|4|Updated Jun 16, 2026
One-click install
npx skills add https://github.com/Hainrixz/claude-db --skill db-referential-integrity
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-referential-integrity
Source: https://github.com/Hainrixz/claude-db/tree/main/skills/db-referential-integrity
Command: npx skills add https://github.com/Hainrixz/claude-db --skill db-referential-integrity

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill audits foreign-key integrity in databases, identifying missing foreign keys, unsafe delete/update actions, reference cycles, and composite-FK mismatches.

Core Features & Use Cases

  • Foreign Key Integrity Audit: Checks for missing foreign keys, unsafe ON DELETE/ON UPDATE actions, reference cycles, and composite-FK mismatches.
  • Integrity on Design: Ensures that the database schema is designed with proper foreign key constraints.
  • Performance on Performance & Scale: Analyzes the impact of foreign key constraints on query performance and scale.
  • Use Case: For a database schema, use this Skill to ensure that all foreign keys are correctly defined and that the database can handle the intended operations without data integrity issues.

Quick Start

Run the db-referential-integrity skill to audit foreign-key integrity in your database.

Frequently Asked Questions about db-referential-integrity

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

FAQPage Schema
How do I audit foreign key constraints in a relational database?

Auditing foreign key constraints involves executing SQL queries against the relational database schema to identify missing foreign keys, unsafe delete/update actions, reference cycles, and composite-FK mismatches for ensuring data integrity.

What are common foreign key integrity issues in database schema design?

Common foreign key integrity issues include missing foreign key constraints, unsafe ON DELETE/ON UPDATE actions that risk orphaned records, reference cycles, and composite-FK mismatches between parent and child tables.

How do I check for composite-FK mismatches and reference cycles in my database?

Checking for composite-FK mismatches and reference cycles requires analyzing the relational database schema by executing SQL queries to validate foreign key definitions and detect circular references between tables.

Do foreign key constraints affect database query performance and scale?

Yes, foreign key constraints affect database query performance and scale. Auditing foreign keys analyzes their impact on query performance to ensure the schema handles intended operations without data integrity issues.

What do I need to check unsafe ON DELETE and ON UPDATE actions in my database?

You need access to the database schema and the ability to execute SQL queries to audit foreign key constraints and identify unsafe ON DELETE and ON UPDATE actions that threaten data integrity.