-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Deprecate AbstractPlatform commented type APIs #5058
Conversation
1af9f1e
to
caf6e29
Compare
src/Platforms/DB2Platform.php
Outdated
@@ -95,6 +95,13 @@ protected function initializeDoctrineTypeMappings() | |||
*/ | |||
public function isCommentedDoctrineType(Type $doctrineType) | |||
{ | |||
Deprecation::trigger( | |||
'doctrine/dbal', | |||
'TODO', |
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.
A link is missing here.
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.
Dang! I did a @derrabus !
*/ | ||
public function requiresSQLCommentHint(AbstractPlatform $platform) | ||
{ | ||
return $platform instanceof DB2Platform; |
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.
dbal/src/Platforms/DB2Platform.php
Lines 99 to 100 in 71b2e68
// We require a commented boolean type in order to distinguish between boolean and smallint | |
// as both (have to) map to the same native type. |
AFAIK, only PostgreSQL natively supports boolean columns but they work on all supported platforms. Is it really necessary to use a comment hint on DB2?
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 forgot to copy the comment I found in DB2Platform
, it explains why this is necessary.
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.
Is it really necessary to use a comment hint on DB2?
I have added the comment, and now I am wondering if we shouldn't require a comment on all platforms but PG
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.
now I am wondering if we shouldn't require a comment on all platforms but PG
I guess it's the opposite and (I misread it as should) we don't need it anywhere (at least with the platform-aware schema comparison in place). We need to find a relevant schema comparison test and see how a scenario of deployment and comparison of a boolean column works say on MySQL.
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.
You read correctly, my sentence has the same meaning with or without n't
(in my intention, now you make me realize what I wrote is properly incorrect english).
I don't understand why you say it would work. If MySQL does not have native support for boolean columns, why would the DBAL reverse engineer to BooleanType
and not SmallIntType
? Or is schema comparison working and not reverse engineering?
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'm not certain it does work, I'm just saying I'm not aware of any related issues, so it may work somehow. We need more testing to understand the details. If it doesn't work anywhere except for PostgreSQL, then it's a separate bug.
On the other hand, the changes here are in line with the existing logic, so this unknown probably shouldn't block the deprecation.
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.
then it's a separate bug.
If it's a bug, then it must be separate because it should target 3.2.x, one more reason not to block this. Plus I have other rabbit holes to dig into :P
caf6e29
to
78ffcf2
Compare
The Type class already has an API for this.
78ffcf2
to
e88ce6d
Compare
The Type class already has an API for this.