简体   繁体   中英

TYPO3 LTS 8 not support datatype JSON

I am using TYPO3 version 8 LTS, I want to alter one column's datatype from text to JSON. Is there any way to do this? I manually changed to JSON but the upgrade wizard shows an error like

Unknown database type JSON requested, Doctrine\\DBAL\\Platforms\\MySQL57Platform may not support it.

Patch to make JSON columns work on TYPO3 v8:

diff --git typo3/sysext/core/Classes/Database/ConnectionPool.php typo3/sysext/core/Classes/Database/ConnectionPool.php
index 5b1adc2a..8f81e615 100644
--- typo3/sysext/core/Classes/Database/ConnectionPool.php
+++ typo3/sysext/core/Classes/Database/ConnectionPool.php
@@ -168,6 +168,7 @@ protected function getDatabaseConnection(array $connectionParams): Connection
         foreach ($this->customDoctrineTypes as $type => $className) {
             $conn->getDatabasePlatform()->registerDoctrineTypeMapping($type, $type);
         }
+        $conn->getDatabasePlatform()->registerDoctrineTypeMapping('json', 'json_array');
 
         // Handler for building custom data type column definitions
         // in the SchemaManager

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM