Skip to content

Add init_db.sh script for database initialization and migration #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Abdulrahman-Elfeky
Copy link

How it works?

  • Runs the existing init_db function
  • Applies database migrations using sqlx-cli
  • Uses environment variables for configuration [POSTGRES_USER, ..... ,SKIP_DOCKER=1]
  • Ensures safe execution
  • Requires psql and sqlx-cli to be installed
  • Make sure to run chmod +x scripts/init_db.sh before executing the script

@Kobzol
Copy link
Contributor

Kobzol commented Mar 21, 2025

Hi! Could you please provide a bit more info, what's the motivation for this? Do you think that the instructions in https://github.com/rust-lang/bors/blob/main/docs/development.md are too complicated and we should have a script for initing the DB? It's kind of hard to predict what environment people have, such scripts will necessarily not work for some people, so I usually rather provide more atomic commands that people can mix & match.

The linker development guide could probably be rewritten to be clearer on what to do if you want to develop on bors though. Maybe that would be better than the script? :)

@Abdulrahman-Elfeky
Copy link
Author

U broke my heart 💔😅
I was just setting the environment to start contributing, and yeah, I found that development docs can be simpler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants