【问题标题】:TYPO3 LTS 8 not support datatype JSONTYPO3 LTS 8 不支持数据类型 JSON
【发布时间】:2020-03-03 11:25:35
【问题描述】:

我正在使用 TYPO3 版本 8 LTS,我想将一列的数据类型从文本更改为 JSON。有没有办法做到这一点?我手动更改为 JSON,但升级向导显示如下错误

请求的未知数据库类型 JSON,Doctrine\DBAL\Platforms\MySQL57Platform 可能不支持。

【问题讨论】:

    标签: mysql json typo3 typo3-8.x


    【解决方案1】:

    使 JSON 列在 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
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-07-24
      • 2015-11-01
      • 1970-01-01
      • 2016-12-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-06
      相关资源
      最近更新 更多