Not a bug Possible MYSQL index bug?

truonglv

Well-known member
Licensed customer
Affected version
2.1.10
Hello,

According this document from MySQL: https://dev.mysql.com/doc/refman/8.0/en/descending-indexes.html

I have try to setup:
PHP:
$table->addKey([
    'column1',
   [ 'column2', 'DESC']
]);

And it's generated to:
Code:
ADD KEY `column1_column2` (`column1`, `column2`(DESC))

It's expected to:
Code:
ADD KEY `column1_column2` (`column1`, `column2` DESC)

Line effected: XF/Db/Schema/Index::364
 
This might change in the future, but this isn't something supported by the schema manager at this time. You'd need a direct query for it.

Note that the array syntax you're trying to use already means something: the second entry represents the prefix length of the column (for string fields).
 
This might change in the future, but this isn't something supported by the schema manager at this time. You'd need a direct query for it.

Note that the array syntax you're trying to use already means something: the second entry represents the prefix length of the column (for string fields).
Thank for explain. I've forgot about index with length too.
 
Back
Top Bottom