0Pricing
Learn Rust Coding · Lesson

Migrations

Evolve the schema.

Why migrations?

A migration is a versioned change to your database schema, like adding a table or column. They let your schema evolve safely and reproducibly.

  • Tracked in version control
  • Applied in order, exactly once

The sqlx-cli tool

sqlx ships a CLI for managing migrations. Install it once with cargo.

cargo install sqlx-cli --no-default-features --features postgres

All lessons in this course

  1. Connecting to a Database
  2. Compile-Time Checked Queries
  3. CRUD Operations
  4. Migrations
← Back to Learn Rust Coding