-
Notifications
You must be signed in to change notification settings - Fork 14
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
Add Statement Batching For PtOnlineSchemaChangeConnection #36
Conversation
Thanks for submitting this PR. I do like the approach, and I'm good with overriding the I'll try to setup a GitHub workflow that automatically tests the package against all supported versions of Laravel & PHP versions to ensure we are not introducing any breaking changes. |
00940f2
to
c9182e1
Compare
The test matrix is the most sure-fire way; but, I think this should be PHP 7.0 compatible and Laravel 5 (src) compatible, now. |
I've added integration tests against both |
Awesome! I'll give this another pass in the coming days. |
c9182e1
to
be5afef
Compare
Looks good to me. I'll merge it in and will create a new release for it |
Thank you for contributing, this was on the TODO list for a while 😄 |
Overview
See #26. This PR makes it so that every individual statement generated as part of
ZeroDowntimeSchema::table
gets passed along topt-online-schema-change
in one go, which is both more performant and seemingly in-line with how nativeSchema
-based migrations work.Thoughts
Blueprint
, perhaps we could make it an opt-in feature by adding in a Laravel version check, azero-downtime.php
+['batched' => true]
config option, and/or a static variable would de-risk the change? The most immediate concern that comes to mind is that this will be incompatible with other libraries overridingBlueprint
.Testing
I haven't extensively manually tested this change yet; but, as a smoke-test, it works with several of my company's migrations and has been batching groups of
$table->dropForeign
and$table->foreign
calls correctly.