-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Address MasterSlaveConnection rename #1096
Conversation
* simplest to set up for. | ||
* | ||
* @see https://github.com/doctrine/migrations/issues/336 | ||
*/ |
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 copy/pasted the comment of the method above.
MasterSlaveConnection has been deprecated in favor of PrimaryReadReplicaConnection, which it extends before being removed in DBAL 3. This ensure both cases are handled when it comes to making sure we connect to the primary, while not bumping the requirement to doctrine/dbal 2.11 (which requires PHP 7.3, although subsequent version might restore compatibility with 7.1).
69300c5
to
dbbd7b3
Compare
@@ -17,6 +17,8 @@ parameters: | |||
- '~^Parameter #1 \$files of method Doctrine\\Migrations\\Finder\\Finder::loadMigrationClasses\(\) expects array<string>, array<int, string\|false> given\.\z~' | |||
- '~^Class Doctrine\\Migrations\\Tests\\DoesNotExistAtAll not found\.\z~' | |||
- '~^Call to method getVersion\(\) of deprecated class PackageVersions\\Versions\.$~' | |||
# Drop when bumping to doctrine/dbal 2.11+ | |||
- '~^.*PrimaryReadReplicaConnection.*$~' |
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.
phpstan is ran on 7.1, which prevents installing a recent enough version of doctrine/dbal
, and generates quite a few errors because the class does not exist. The errors can be seen (for now) at https://github.com/doctrine/migrations/runs/1489165823?check_suite_focus=true
Summary
MasterSlaveConnection has been deprecated in favor of
PrimaryReadReplicaConnection, which it extends before being removed in
DBAL 3. This ensure both cases are handled when it comes to making sure
we connect to the primary, while not bumping the requirement to
doctrine/dbal 2.11 (which requires PHP 7.3, although subsequent version
might restore compatibility with 7.1).