Skip to content

Commit

Permalink
Fixed MySQL 5.7 compatibility
Browse files Browse the repository at this point in the history
’’’
General error: 3065 Expression #1 of ORDER BY clause is not in SELECT list, references column information_schema.kcu.ORDINAL_POSITION
’’’
  • Loading branch information
SilverFire committed Sep 16, 2017
1 parent 4c1522c commit 1da39fb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion db/mysql/Schema.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,8 @@ private function loadTableConstraints($tableName, $returnType)
`kcu`.`REFERENCED_TABLE_NAME` AS `foreign_table_name`,
`kcu`.`REFERENCED_COLUMN_NAME` AS `foreign_column_name`,
`rc`.`UPDATE_RULE` AS `on_update`,
`rc`.`DELETE_RULE` AS `on_delete`
`rc`.`DELETE_RULE` AS `on_delete`,
`kcu`.`ORDINAL_POSITION` as `position`
FROM (SELECT DATABASE() AS `name`) AS `sch`
INNER JOIN `information_schema`.`KEY_COLUMN_USAGE` AS `kcu`
ON `kcu`.`TABLE_SCHEMA` = COALESCE(:schemaName, `sch`.`name`) AND `kcu`.`CONSTRAINT_SCHEMA` = `kcu`.`TABLE_SCHEMA` AND `kcu`.`TABLE_NAME` = :tableName
Expand Down

0 comments on commit 1da39fb

Please sign in to comment.