-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
DBAL-781: Doctrine maps tinyint with length > 1 to boolan #2011
Comments
|
Comment created by @deeky666: [~stefano.kowalke] The length parameter for MySQL's integer does not have any effect unless you use it in conjunction with the ZEROFILL attribute. It does not have any meaning concerning min or max value and the storage requirements for that specific type but only specifies the display length for zerofill characters. {quote} As MySQL does not have a native boolean type, Doctrine uses it to map it's own boolean type as it is the one that comes closest to a "boolean" type column. This is not a bug in Doctrine but an expected behaviour. |
Comment created by stefano.kowalke: Hey Steve, thanks for your detailed informations. This helped me to understand the behavior and gave me a direction how to get more background informations. |
Issue was closed with resolution "Invalid" |
Comment created by jonny827: @Steve Muller - I believe Doctrine2 developers made a huge design flaw in doing this for the following reasons:
Love your application, thank you very much for being SPL friendly(data mapper) stable 2.x, part of symphony install by default/massive tutorial/knowledge base online, more contributors, active contributors, ROADMAP(they refuse to use one in PROPEL), easier to unit test. I spent weeks reading every word about both. Thank you for listening. |
Nope, because most users rely on tinyint to always be considered boolean.
Just use migrations from there on...
…On 7 Apr 2017 6:37 a.m., "vafrcor" ***@***.***> wrote:
Can we fix this, MySQL Platform\initializeDoctrineTypeMappings
()\$doctrineTypeMapping
to change 'tinyint' => 'boolean', become 'tinyint' => 'smallint',
Thank you.
code preview:
[image: screen shot 2017-04-07 at 11 33 44 am]
<https://cloud.githubusercontent.com/assets/2148366/24785729/610e8f76-1b86-11e7-887e-a8a16fdc776f.png>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2011 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAJakPP8so7HZHCgY5aPBEDYFfqkd3apks5rtb2VgaJpZM4M2cz7>
.
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Jira issue originally created by user stefano.kowalke:
Why Doctrine maps any tinyint, regardless its length to boolean type. According to the MySQL Documentation only tinyint(1) is equivalent to boolean. I searched the web and found only out that this is the way how Doctrine it does but not why, so I have to assume its a bug.
Hope someone who knows Doctrine better could enlighten me :-)
The text was updated successfully, but these errors were encountered: