Skip to content

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 login

Core 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/current

Your schemas/current directory will look like this:

schemas/current/
└── public/
    ├── enums.sql
    ├── tables/
    │   ├── users.sql
    │   └── orders.sql
    ├── views/
    │   └── active_users.sql
    └── functions/
        └── calculate_discount.sql

2. 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/target

The CLI shows you the migration plan, risk summary, and affected components. Choose Apply to execute the changes or Abort to exit.

Next Steps ​

See the Best Practices guide for more tips.