From 69225d9dab4eb5ba26f323509aecd85a3a807641 Mon Sep 17 00:00:00 2001 From: Benjamin Morel Date: Sat, 1 Dec 2018 23:15:19 +0100 Subject: [PATCH] Fix getListTableColumnsSQL() columns order on MySQL 8.0 --- lib/Doctrine/DBAL/Platforms/MySqlPlatform.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php index a141f928f01..c5ddac041b0 100644 --- a/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php +++ b/lib/Doctrine/DBAL/Platforms/MySqlPlatform.php @@ -376,7 +376,8 @@ public function getListTableColumnsSQL($table, $database = null) return 'SELECT COLUMN_NAME AS Field, COLUMN_TYPE AS Type, IS_NULLABLE AS `Null`, ' . 'COLUMN_KEY AS `Key`, COLUMN_DEFAULT AS `Default`, EXTRA AS Extra, COLUMN_COMMENT AS Comment, ' . 'CHARACTER_SET_NAME AS CharacterSet, COLLATION_NAME AS Collation ' . - 'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $database . ' AND TABLE_NAME = ' . $table; + 'FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = ' . $database . ' AND TABLE_NAME = ' . $table . ' ' . + 'ORDER BY ORDINAL_POSITION ASC'; } public function getListTableMetadataSQL(string $table, ?string $database = null) : string