diesel_cli is needed to create migrations and apply them. To install the tool, use cargo with the following parameters:
cargo install diesel_cli
However you need development packages for PostgreSQL, MySQL, and SQLite to build this tool. If you don't have or can't install them, you can pass special parameters to cargo install. For example, if you want to use diesel_cli with the example in this chapter, it's enough to install the tool with the sqlite feature only:
cargo install diesel_cli --no-default-features --features "sqlite"
When you have installed the diesel-cli tool, run it to prepare the application using the setup command to use the diesel crate:
diesel setup
Now, we have to prepare all the necessary migrations for our example.