juspay / hyperswitch

An open source payments switch written in Rust to make payments fast, reliable and affordable
https://hyperswitch.io/
Apache License 2.0
11.08k stars 1.19k forks source link

[Feature] Add a cargo binary for running diesel migrations locally #4589

Closed lsampras closed 2 days ago

lsampras commented 2 months ago

Objective

Add a new binary in the router crate that would run migrations locally via cli i.e cargo run migrations.

Context

Currently migrations are managed via the diesel_cli which rely on explicitly providing the database username/password & host, This is a bit cumbersome when you have to provide the variables over & over again.

diesel migration --database-url postgres://$DB_USER:$DB_PASS@localhost:5432/$DB_NAME run

It would be somewhat easier if we could leverage diesel_migrations to read the credentials from config file / env & apply migrations.

(Open to alternative approaches as well for this)

Outcomes

davidkurilla commented 1 month ago

I am interested in taking on this issue!

lsampras commented 1 month ago

Hey @davidkurilla , thanks for your interest. I'm assigning you this issue, you can ask any doubts here or reach out to me or @SanchithHegde on our slack/discord.

In case you are considering alternative approaches (apart from what I've described in the issue description) would love if you could share them here before starting implementation.