https://github.com/LukeMathWalker/zero-to-production
Install the CLI:
cargo install sqlx-cli --version=0.5.7 --no-default-features --features postgres
Creating a migration:
# DATABASE_URL needs to be exported only if direnv hasn't been set up yet.
export DATABASE_URL=postgres://postgres:password@localhost:5432/newsletter
sqlx migrate add create_subscriptions_table
Run migration:
sqlx migrate run