Skip to content
Snippets Groups Projects
Commit 86789207 authored by Stefan Bürk's avatar Stefan Bürk
Browse files

[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: default avatarcore-ci <typo3@b13.com>
Tested-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: default avatarGarvin Hicking <gh@faktor-e.de>
Reviewed-by: default avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: default avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: default avatarStefan Bürk <stefan@buerk.tech>
Tested-by: default avatarGarvin Hicking <gh@faktor-e.de>
parent 73a1e9ec
Showing
with 296 additions and 1 deletion
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment