Appearance
Quick Start Guide
Prerequisites
- Supported OS: Windows, macOS, Linux
Install
See the Installation page for your platform's instructions.
No account needed. The CLI works immediately after installation.
You can optionally authenticate with a migrata account:
bash
migrata auth loginCore Workflow
1. Inspect a live database
Capture your current schema into local SQL files:
bash
migrata schema inspect \
--from "postgresql://user:pass@host:5432/db" \
--to ./schemas/currentYour schemas/current directory will look like this:
schemas/current/
└── public/
├── enums.sql
├── tables/
│ ├── users.sql
│ └── orders.sql
├── views/
│ └── active_users.sql
└── functions/
└── calculate_discount.sql2. Make your changes
Edit the SQL files to reflect your desired schema. For example, add a column to tables/users.sql or create a new table.
3. Diff against your target
Compare the current schema against your edited version:
bash
migrata diff \
--from ./schemas/current \
--to ./schemas/targetThe CLI shows you the migration plan, risk summary, and affected components. Choose Apply to execute the changes or Abort to exit.
Next Steps
- Learn the full Migration Workflow from inspect through apply
- Use Dev-Database Validation to test changes in an ephemeral Docker container
- Define repeatable commands in YAML/JSON config files
- Set
--include "public*"to limit scope to your main schema - Run with
--approveand--answerfor automated CI/CD runs
See the Best Practices guide for more tips.