Schema health
A linter for your database design. Skeema checks every ER schema against nine 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 nine rules
| Rule | Severity | Why it matters |
|---|---|---|
| Missing primary key | Error | Rows can’t be uniquely identified or referenced. |
| Missing timestamps | Warning | No created_at / updated_at makes auditing and sorting hard. |
| Enum candidate | Info | A status string with few values should be a constrained enum. |
| Missing UNIQUE | Warning | Natural keys (email) without UNIQUE allow duplicates. |
| Missing FK index | Info | Unindexed foreign keys make joins slow at scale. |
| Orphan entity | Info | A table with no relationships is often a modeling mistake. |
| Redundant columns | Warning | Duplicated data risks update anomalies — denormalize on purpose only. |
| Naming consistency | Info | Mixed snake_case / camelCase makes the schema harder to use. |
| Wide entity | Warning | A table with too many columns often wants splitting. |
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 nine 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.
- ✓Nine rules cover keys, indexes, 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.