0

I'm using Magento 2.3.4 for my website, when I try to reindex, the category flat was not reindex and appear error like this:

enter image description here

I search some post in here and try this solution:

magento 2.3.4 installation issue in localhost

But it's still not work.

How I can fix this?

Thank you very much!

Tomato
  • 121
  • 4

2 Answers2

2

I solved it like this:

Insert these lines into getDdlTypeByColumnType function of "vendor/magento/module-eav/Model/ResourceModel/Helper.php"

        case 'int unsigned':
            $columnType = 'int';
            break;
        case 'smallint unsigned':
            $columnType = 'smallint';
            break;

BEFORE:

public function getDdlTypeByColumnType($columnType)
{
    switch ($columnType) {
        case 'char':
        case 'varchar':
            $columnType = 'text';
            break;
        case 'tinyint':
            $columnType = 'smallint';
            break;
        default:
            break;
    }
    return array_search($columnType, $this->_ddlColumnTypes);
}

AFTER:

public function getDdlTypeByColumnType($columnType)
{
    switch ($columnType) {
        case 'int unsigned':
            $columnType = 'int';
            break;
        case 'smallint unsigned':
            $columnType = 'smallint';
            break;
        case 'char':
        case 'varchar':
            $columnType = 'text';
            break;
        case 'tinyint':
            $columnType = 'smallint';
            break;
        default:
            break;
    }
    return array_search($columnType, $this->_ddlColumnTypes);
}
skubrik
  • 21
  • 4
0

This solution works for me. Also I added this code to switch case statement.

case 'bigint unsigned':
     $columnType = 'bigint';
     break;
dajich
  • 1