[FEATURE] Add MySQL default value support for TEXT, JSON and BLOB
Database default value configuration for TEXT, BLOB and JSON field types has been impossible to use in a cross database vendor manner due to lacking support from MySQL. Direct default values are still unsupported, but since `MySQL 8.0.13+` [1] it is possible to use a default value expression with a slightly different syntax. TYPO3 v13.0 already raised the minimal requirement to MySQL 8.0.17 paving the way to provide a compatible way to define default values on database level now. To align the TYPO3 Database Analyzer stack ... * the extended `MySQLSchemaManager` is modified to revert default value expression to concrete values to make them comparable. * default value expression are created for these field types by modifing the extended Doctrine MySQL platform classes using the `MySQLDefaultValueDeclarationSQLOverrideTrait`. This change now adds support for database level default values for TEXT, JSON and BLOB fields and is accompanied by additional tests. NOTE: This unblocks TCA type=input default schema management. [1] https://dev.mysql.com/doc/relnotes/mysql/8.0/en/news-8-0-13.html#mysqld-8-0-13-data-types Resolves: #103578 Releases: main Change-Id: I61c63335b6d0edc80608c246db2e2f6dbae88223 Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83556 Tested-by:core-ci <typo3@b13.com> Tested-by:
Christian Kuhn <lolli@schwarzbu.ch> Reviewed-by:
Garvin Hicking <gh@faktor-e.de> Reviewed-by:
Christian Kuhn <lolli@schwarzbu.ch> Tested-by:
Stefan Bürk <stefan@buerk.tech> Reviewed-by:
Stefan Bürk <stefan@buerk.tech> Tested-by:
Garvin Hicking <gh@faktor-e.de>
Showing
- typo3/sysext/core/Classes/Database/Platform/MySQL80Platform.php 2 additions, 0 deletions...sysext/core/Classes/Database/Platform/MySQL80Platform.php
- typo3/sysext/core/Classes/Database/Platform/MySQLPlatform.php 2 additions, 0 deletions...3/sysext/core/Classes/Database/Platform/MySQLPlatform.php
- typo3/sysext/core/Classes/Database/Platform/Traits/MySQLDefaultValueDeclarationSQLOverrideTrait.php 96 additions, 0 deletions...m/Traits/MySQLDefaultValueDeclarationSQLOverrideTrait.php
- typo3/sysext/core/Classes/Database/Schema/Parser/TableBuilder.php 1 addition, 1 deletion...sext/core/Classes/Database/Schema/Parser/TableBuilder.php
- typo3/sysext/core/Classes/Database/Schema/SchemaManager/MySQLSchemaManager.php 62 additions, 0 deletions...sses/Database/Schema/SchemaManager/MySQLSchemaManager.php
- typo3/sysext/core/Documentation/Changelog/13.1/Feature-103578-AddDatabaseDefaultValueSupportForTEXTBLOBAndJSONFieldTypes.rst 61 additions, 0 deletions...tabaseDefaultValueSupportForTEXTBLOBAndJSONFieldTypes.rst
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/Assertions/json-default-empty-array-value.csv 3 additions, 0 deletions...efaultValue/Assertions/json-default-empty-array-value.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/Assertions/json-default-empty-object-value.csv 3 additions, 0 deletions...faultValue/Assertions/json-default-empty-object-value.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/Assertions/json-default-null.csv 3 additions, 0 deletions...es/JsonFieldDefaultValue/Assertions/json-default-null.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/Assertions/json-not-null-default-empty-array-value.csv 3 additions, 0 deletions...ue/Assertions/json-not-null-default-empty-array-value.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/Assertions/json-not-null-default-empty-object-value.csv 3 additions, 0 deletions...e/Assertions/json-not-null-default-empty-object-value.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/json-default-empty-array-value.sql 9 additions, 0 deletions.../JsonFieldDefaultValue/json-default-empty-array-value.sql
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/json-default-empty-object-value.sql 9 additions, 0 deletions...JsonFieldDefaultValue/json-default-empty-object-value.sql
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/json-default-null.sql 9 additions, 0 deletions...base/Fixtures/JsonFieldDefaultValue/json-default-null.sql
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/json-not-null-default-empty-array-value.sql 9 additions, 0 deletions...dDefaultValue/json-not-null-default-empty-array-value.sql
- typo3/sysext/core/Tests/Functional/Database/Fixtures/JsonFieldDefaultValue/json-not-null-default-empty-object-value.sql 9 additions, 0 deletions...DefaultValue/json-not-null-default-empty-object-value.sql
- typo3/sysext/core/Tests/Functional/Database/Fixtures/TextFieldDefaultValue/Assertions/text-default-empty-string-value.csv 3 additions, 0 deletions...faultValue/Assertions/text-default-empty-string-value.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/TextFieldDefaultValue/Assertions/text-default-null.csv 3 additions, 0 deletions...es/TextFieldDefaultValue/Assertions/text-default-null.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/TextFieldDefaultValue/Assertions/text-not-null-default-empty-string-value.csv 3 additions, 0 deletions...e/Assertions/text-not-null-default-empty-string-value.csv
- typo3/sysext/core/Tests/Functional/Database/Fixtures/TextFieldDefaultValue/Assertions/text-not-null-default-value-string-value.csv 3 additions, 0 deletions...e/Assertions/text-not-null-default-value-string-value.csv
Please register or sign in to comment