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!

1
  • Did you solved ? i am also getting this Commented Nov 23, 2020 at 14:33

2 Answers 2

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);
}
0

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

case 'bigint unsigned':
     $columnType = 'bigint';
     break;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.