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

Fix loading issue with rake db:create on Rails 7.2 #418

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

dorner
Copy link
Contributor

@dorner dorner commented Nov 5, 2024

Fixes #415.

This issue seems to only happen if a connection isn't created during startup. Not sure why other representative apps don't have this problem - there might be something in an initializer that creates the connection before trying to run the rake task. But from a pure perspective, the postgis adapter file may not load by the time the db:create tasks runs.

This PR moves the registration to the topmost file, which seems to solve this problem.

@BuonOmo
Copy link
Member

BuonOmo commented Nov 6, 2024

I saw in the issue that you had issues testing it. Could you test it manually at least ? And did it work properly ?

@seuros
Copy link
Contributor

seuros commented Nov 6, 2024

I could not reproduce this.

@dorner
Copy link
Contributor Author

dorner commented Nov 6, 2024

Let me try to put together a minimal app that can reproduce it.

@dorner
Copy link
Contributor Author

dorner commented Nov 6, 2024

Will post back at the issue.

@dorner
Copy link
Contributor Author

dorner commented Nov 6, 2024

I saw in the issue that you had issues testing it. Could you test it manually at least ? And did it work properly ?

Yep, I tested this locally and confirmed that it doesn't work on the latest (10.0) but does work on my branch.

Copy link
Member

@keithdoggett keithdoggett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was also unable to reproduce this, but as long as this doesn't break anything else I don't have an issue with moving this to load earlier

@dorner
Copy link
Contributor Author

dorner commented Nov 7, 2024

@keithdoggett did you check what I posted on the issue? I was able to reproduce it with a multi-database configuration.

@keithdoggett
Copy link
Member

@dorner yes, that makes sense it only happens in that case. Did you test that it works properly for an app with a single db still? This seems good to merge though

@dorner
Copy link
Contributor Author

dorner commented Nov 15, 2024

Yep, confirmed it still works with the standard database.yml.

@keithdoggett keithdoggett merged commit eb475fb into rgeo:master Nov 15, 2024
16 checks passed
@keithdoggett
Copy link
Member

keithdoggett commented Nov 15, 2024

Great, thanks @dorner

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.

db:create not working on branch bump-7-2
4 participants