rent
ReferenceCommand line

rent migrate preflight

rent migrate preflight answers three questions without changing the database: can Rent inspect this database, is the proposed SQL valid for its dialect, and which changes are safe, need review, or are destructive?

Review a normal change

rent migrate preflight
Migration plan

Database   postgres
Changes    2 total (1 safe, 1 review, 0 destructive)

1. SAFE        add column public.posts.summary (text)
2. REVIEW      create index posts_slug_key on public.posts

Ready: Migration SQL is valid.

Safe operations preserve existing rows. Review operations require attention to deployment cost or locking. Destructive operations can discard data and always require explicit approval at application time.

Detect a destructive change

rent migrate preflight --drop-objects
Migration plan

Database   postgres
Changes    1 total (0 safe, 0 review, 1 destructive)

1. DESTRUCTIVE drop column public.posts.legacy_slug

Review required: Destructive changes need explicit approval.

Produce machine-readable output

rent migrate preflight --format json
{
  "dialect": "postgres",
  "operations": [],
  "ready": true,
  "rename_suggestions": [],
  "summary": {
    "destructive": 0,
    "review": 0,
    "safe": 0,
    "total": 0
  }
}

rename_suggestions lists table and column drop-and-add pairs that look like renames, with the @@rent.previousName or @rent.previousName hint that would preserve their data.

The JSON form is useful for deployment checks and custom review tooling.

On this page