Rustango docs

Migrations

Evolve your schema with autogenerated, version-controlled migrations.

The workflow

Edit a model, then run makemigrations to diff it against the last schema snapshot and emit a new JSON migration. migrate applies pending migrations; showmigrations lists state; downgrade rolls back the latest.

cargo run -- makemigrations   # diff models -> new migration
cargo run -- migrate          # apply pending
cargo run -- showmigrations   # applied / pending
cargo run -- downgrade        # roll back the last one

Migrations are tri-dialect: the same chain emits correct DDL on Postgres, MySQL, and SQLite. Commit the generated JSON alongside your code.

Embedded migrations

embed_migrations!("migrations") bakes the chain into the binary and validates it at compile time, so a release ships its own schema.