How to Run Database Migrations in Rust

Rust requires external tools like Diesel or SQLx to run database migrations via their specific CLI commands.

Rust does not have a built-in database migration command; you must use a third-party tool like diesel or sqlx and run its specific CLI command. For example, using Diesel, you run the migration command directly in your project root:

diesel migration run

If you are using sqlx, the equivalent command is:

sqlx migrate run