Prompt file imported from vamshi620/SQL_AGENT (
.github/prompts/db-health-check.prompt.md). Copyright stays with the author.
Database Schema Health Check
Run a complete health check on the database schema.
Instructions
- Call
get_db_schemato fetch the full schema (no table filter — get everything) - Apply the
schema-analysisskill to analyze the results - Produce a health report with these sections:
Schema Inventory
- Total tables, grouped by domain cluster
🔴 Critical Issues
- Nullable primary keys
- Tables with no primary key
- Tables with no rows (possibly orphaned)
🟠Major Issues
- Foreign keys without covering indexes
- Missing
IsDeleted BITsoft-delete column - Tables without
CreatedAt/UpdatedAtaudit columns
🟡 Minor Issues
VARCHARinstead ofNVARCHARcolumnsDATETIMEinstead ofDATETIME2columns- Columns named ambiguously (e.g.,
Date,Name,Statuswithout prefix)
✅ Good Patterns Found
- Well-named tables, proper indexes, good audit columns
Recommended Actions
- Numbered list of fixes ordered by severity
Format the output as a clean markdown table for each section.