-
Notifications
You must be signed in to change notification settings - Fork 504
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
only migrate specified shards. #508
only migrate specified shards. #508
Conversation
Since this PR is part of the Rails 5.2 migration, I'm merging it. |
Doesn't this changeset make the assumption that all migrations should be run across any shards returned from EDIT: Gonna ping @kevinjcoleman @thiagopradi to try to get this sorted out, I now have migrations being run on a shard with a different schema than my primary shard. |
@PhilCoggins you're correct i think. Before it was sending it all the shards for a connection which was all shards anyway. I've been meaning to look into this since I've noticed the same thing with our migrations. My current fix has been to just check the current shard for that migration and skip if I don't want it to be run there. IE:
|
Thanks for the response, I fixed with a quick monkey patch below, but have no idea what impact it may have on other systems. I think this needs to be prioritized and fixed rather quickly to prevent people messing up their schemas (hopefully they're testing!).
|
@PhilCoggins feel free to make a PR, I don't have the time at the moment and @thiagopradi isn't really maintaining the gem anymore. If you make a PR though he might merge it! |
I'll make a PR and take lead, but would like to hear from @thiagopradi on my snippet above first as I'm sure he can better explain some of the complexities here. I have also noticed rollbacks have some issues on selecting the correct shard. I know he's not maintaining the gem anymore, but it's my understanding that he is committed to helping to provide a clean migration path until we get to Rails 6. |
I think this is what is causing my error: #512 Though I am not sure because I am running a 4.2 app. In the meantime, I'm not sure where to put your monkey patch @PhilCoggins as in an initializer I get: I have taken to just forking the gem and removing the migration support all together as I don't need it. |
@PhilCoggins We just faced the exact issue you described above and your monkey-patch helped! (Thank you) |
@ajaleelp glad that it helped, I never worked on a fix as I don't feel comfortable with the code base, and I never heard back from the author when I pinged for help several times. Just working my way to Rails 6... |
- Migrations seem to be trying to run on all shards. - thiagopradi#508 (comment)
No description provided.