Schema tooling (CLI)
Schema commands help you inspect and snapshot the database.
Prerequisites
What You’ll Learn
- How to dump schema snapshots for fast environment bootstraps
- When to use
--prune - How to inspect schema state in text or JSON form
Step Outcome
By the end of this page, you should be able to:
- Produce schema dumps for faster environment provisioning
- Decide when pruning is safe
- Inspect schema state in machine-readable form
Dump schema
schema:dump writes a SQL file that can be loaded into empty databases before migrations run (useful for CI and fast test setup).
dart run ormed_cli:ormed schema:dump
dart run ormed_cli:ormed schema:dump --database testing
dart run ormed_cli:ormed schema:dump --path database/schema.sql
Prune Dart migration files (optional)
dart run ormed_cli:ormed schema:dump --prune
--prune currently removes *.dart migration files in migrations.directory.
Treat --prune as a coordinated release operation, not a routine dev command.
Describe schema
dart run ormed_cli:ormed schema:describe
dart run ormed_cli:ormed schema:describe --json
Read This Next
Verify Schema Tooling
dart run ormed_cli:ormed schema:describe --json
dart run ormed_cli:ormed schema:dump --path database/schema.sql