Laravel Truss 1.5: the schema doctor #18
Pinned
albertoarena
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Truss 1.5 is out, and it brings the biggest addition since the diagram itself: the schema doctor.
Truss already shows you your database structure. The doctor tells you what looks wrong with it, reading structure alone: no row data, no AI, no query stats.
What it catches
Run it and it flags problems visible from structure alone:
floatdeleted_at, and moreThirteen rules across integrity, index, and type categories, each with a stable code (like
TRUSS-IDX-001) so you can look it up, silence it, or change its severity.In the terminal and CI
It exits non-zero when a finding is at or above your fail level, so a migration that introduces a problem fails the build. Deterministic and structure-only, safe for CI and commit hooks.
Rules are engine-aware where it matters: an unindexed foreign key is an error on PostgreSQL and SQLite, and only info on MySQL and MariaDB, which auto-index them.
In the dashboard
The same findings appear in the dashboard as the Health panel (the heart in the toolbar). Tables with a problem are flagged right on the diagram, the offending column is marked inline, and heuristic (lower-confidence) findings are marked as such. Same feature, same findings, two front ends.
Try it
The live demo has it running. Open the Health panel and you will see a handful of foreign keys flagged for a missing index.
Update with
composer update albertoarena/laravel-truss, then runphp artisan truss:doctor.Feedback welcome
This is Phase 1: the engine and thirteen rules. Suppression files, more rules, and CI formatters are on the roadmap. If a rule feels too noisy, too quiet, or you want a check that is not there yet, reply here. I would love to hear what you run it against.
All reactions