-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
Conversation
I saw in the issue that you had issues testing it. Could you test it manually at least ? And did it work properly ? |
I could not reproduce this. |
Let me try to put together a minimal app that can reproduce it. |
Will post back at the issue. |
Yep, I tested this locally and confirmed that it doesn't work on the latest (10.0) but does work on my branch. |
There was a problem hiding this 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
@keithdoggett did you check what I posted on the issue? I was able to reproduce it with a multi-database configuration. |
@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 |
Yep, confirmed it still works with the standard database.yml. |
Great, thanks @dorner |
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.