Skip to content

Commit

Permalink
Fix index columns order on MySQL 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BenMorel committed Dec 2, 2018
1 parent e8d1fdc commit e9664f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public function getListTableIndexesSQL($table, $currentDatabase = null)
'SEQ_IN_INDEX AS Seq_in_index, COLUMN_NAME AS Column_Name, COLLATION AS Collation, ' .
'CARDINALITY AS Cardinality, SUB_PART AS Sub_Part, PACKED AS Packed, ' .
'NULLABLE AS `Null`, INDEX_TYPE AS Index_Type, COMMENT AS Comment ' .
'FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $table . ' AND TABLE_SCHEMA = ' . $currentDatabase;
'FROM information_schema.STATISTICS WHERE TABLE_NAME = ' . $table . ' AND TABLE_SCHEMA = ' . $currentDatabase .
' ORDER BY SEQ_IN_INDEX ASC';
}

return 'SHOW INDEX FROM ' . $table;
Expand Down

0 comments on commit e9664f6

Please sign in to comment.