Skip to content

Commit 812b436

Browse files
authored
Make query in SchemaHashMysql independent from internal sorting (#608)
1 parent 2b9b044 commit 812b436

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

src/DbSchema/SchemaHasherMysql.php

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,19 +43,24 @@ public function hashDb(): string
4343
SELECT
4444
MD5(
4545
GROUP_CONCAT(
46-
CONCAT(
47-
COALESCE(COLUMN_NAME, ""),
48-
COALESCE(EXTRA, ""),
49-
COLUMN_TYPE,
50-
IS_NULLABLE
51-
)
46+
InnerSelect.columns
5247
)
5348
) AS dbsignature,
5449
1 AS grouper
55-
FROM
56-
information_schema.columns
57-
WHERE
58-
table_schema = DATABASE()
50+
FROM (
51+
SELECT
52+
CONCAT(
53+
COALESCE(COLUMN_NAME, ""),
54+
COALESCE(EXTRA, ""),
55+
COLUMN_TYPE,
56+
IS_NULLABLE
57+
) as columns
58+
FROM
59+
information_schema.columns
60+
WHERE
61+
table_schema = DATABASE()
62+
ORDER BY table_name, column_name
63+
) as InnerSelect
5964
GROUP BY
6065
grouper';
6166

0 commit comments

Comments
 (0)