Skip to content
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

Change how we establish connection + Rails 6 support #15

Merged
merged 8 commits into from
Nov 9, 2023
Merged

Conversation

mscoutermarsh
Copy link
Member

A refactor of the rake tasks to make use of pscale password create instead of pscale connect.

Replacing pscale connect with creds

Currently the gem runs pscale connect to establish a local port connection to PlanetScale. This can cause problems in some environments. Plus it requires customization of the apps database.yml.

This PR changes the gem so that we instead create credentials, set them as DATABASE_URL and connect directly to the PlanetScale DB. After the command is run, the credentials are removed.

Rails 6 support

Opening up the dependencies to allow Rails 6. Nearly everything works the same as Rails 7 with the exception of db:rollback for multiple database apps running on versions older than 6.1.

By using credentials, we are able to make the rake tasks more reliable (some envs would fail using pscale connect).

We are also able to remove the need for people to have to configure `database.yml` specifically to work with this gem.

By setting `DATABASE_URL`, we override what is set in `database.yml`.
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