Schema health
A linter for your database design. Skeema checks every ER schema against eleven static rules and grades it 0–100, catching the issues that cause data bugs and slow queries before they reach production.
Why validate a schema?
Schema mistakes are expensive because they’re hard to undo once data lands. A missing index turns a fast query slow at scale; a missing unique constraint lets duplicates in; a missing foreign-key index makes joins crawl. Schema health catches these at design time, when they’re free to fix.
The eleven rules
| Rule | Severity | Why it matters |
|---|---|---|
| Missing primary key | Error | Rows can’t be uniquely identified or referenced. |
| Invalid FK target | Error | A foreign key that points at a table or column that doesn’t exist. |
| Required cycle | Error | Two tables that each require the other can never insert their first row. |
| Enum candidate | Warning | A status string with few values should be a constrained enum. |
| Missing UNIQUE | Warning | Natural keys (email) without UNIQUE allow duplicates. |
| Missing relation | Warning | A *_id column with no declared relationship hides the link from tools and readers. |
| Orphan entity | Warning | A table with no relationships is often a modeling mistake. |
| Wide entity | Warning | A table with 15+ columns often wants splitting. |
| Missing timestamps | Info | No created_at / updated_at makes auditing and sorting hard. |
| Redundant columns | Info | Duplicated data risks update anomalies — denormalize on purpose only. |
| Naming consistency | Info | Mixed snake_case / camelCase makes the schema harder to use. |
How the score works
The grade is a simple, transparent formula:
score = 100 − (10 × errors) − (4 × warnings) − (1 × infos), clamped to 0–100, then mapped to a letter grade (A ≥ 90, B ≥ 80, C ≥ 70, D ≥ 60, else F). Errors hurt most because they cause correctness bugs; infos are gentle nudges.Static rules vs AI suggestions
The eleven rules are static — deterministic, instant, and free. For deeper review, opt into AI suggestions, which look at normalization (3NF), soft-delete patterns, and modeling improvements the static rules don’t cover. The AI is explicitly told not to repeat static-rule territory, so the two are complementary.
- ✓Schema health is a design-time linter — fix data issues before data exists.
- ✓Eleven rules cover keys, relations, constraints, normalization, and naming.
- ✓Score = 100 − 10·errors − 4·warnings − 1·infos, graded A–F.
- ✓Static rules are instant and free; opt into AI suggestions for deeper normalization advice.