support mysql8+ default values for text data types#7242
support mysql8+ default values for text data types#7242paulmhh wants to merge 1 commit intodoctrine:3.10.xfrom
Conversation
mysql requires text type column defaults to be written as expressions https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html DEFAULT ('text literal')
|
Thank you. Please add tests. |
|
Support of default values for these types has been introduced with MySQL 8.0.13 [1]. I just wanted to mention this, as this leaves a gap where this is not supported and would lead to errors. Not sure if it would still be okay to add it that way. Special as the pull-request is addressed to go back into 3.10.x as bugfix. @derrabus We added that to TYPO3 and the extended platforms, but required to also adopt the MySQLSchemaManager to normalize it again later on. If I remember right, that was due to the need that we kept the comparision based on the columns and not using the created colum sql check back then. Could be possible that we do not need that anymore as we dropped the old way and I guess it should not be required anymore. Just wanted to link it here https://review.typo3.org/c/Packages/TYPO3.CMS/+/83556 For TYPO3 we have raised lowest supported MySQL version to 8.0.17+ anyway and that was the reason why I (we) did not provided that upstream yet. [1] https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-data-types |
mysql requires text type column defaults to be written as expressions
https://dev.mysql.com/doc/refman/8.0/en/data-type-defaults.html
=> correct mysql8+ syntax is:
DEFAULT ('text literal')
Summary
mysql8+ does support default values for text typed columns (text, blob, json, geometry)
doctrine disallows this and silently drops the default value