关于将magento升级到2.3.0的Tinytext问题

Vij*_*pta 3 magento2

在Magento中,我的网站的当前版本是magento 2.2.5。现在,我已将其更新为最新版本的magento 2.3.0。但是我跑步时出现错误

php bin / magento设置:升级

我得到这个错误

无法将定义处理为类型为tinytext的数组

请给我建议解决方案。谢谢

小智 6

由于任何第三方扩展的表的列的“数据类型”为tinytext,因此出现此错误。

因此,您需要在以下文件中使用debug找出列名。

打开此文件/vendor/magento/framework/Setup/Declaration/Schema/Db/DefinitionAggregator.php并检查此fromDefinition()方法,然后添加调试代码以查找列名。

public function fromDefinition(array $data)
    {
        $type = $data['type'];
        if (!isset($this->definitionProcessors[$type])) {

            /* Add Code for Debug */

            echo "<pre>";
            print_r($data); exit();

            /* Code End */

            throw new \InvalidArgumentException(
                sprintf("Cannot process definition to array for type %s", $type)
            );
        }

        $definitionProcessor = $this->definitionProcessors[$type];
        return $definitionProcessor->fromDefinition($data);
    }
Run Code Online (Sandbox Code Playgroud)

之后,请运行setup:upgrade命令,您将在控制台中获得列数据数组。因此,从此数组中,您将从第三方扩展表中获取列名。

现在,从该表中,将列的数据类型“ tinytext”更改为“ text”,问题将得到解决。

注意:您也可能也会遇到ENUM和MEDIUMINT数据类型的问题,因此如果遇到其他任何数据类型的问题,请执行相同的步骤。