File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ public function getAllColumnsInTable(string $tableName): Collection
4949 return DB ::table ('INFORMATION_SCHEMA.COLUMNS ' )
5050 ->where ('TABLE_SCHEMA ' , config ('database.connections.mysql.database ' ))
5151 ->where ('TABLE_NAME ' , $ tableName )
52+ ->orderBy ('ORDINAL_POSITION ' )
5253 ->get ();
5354 }
5455
@@ -63,6 +64,7 @@ public function extractForeignKeys(string $tableName): Collection
6364 ->where ('TABLE_SCHEMA ' , config ('database.connections.mysql.database ' ))
6465 ->where ('TABLE_NAME ' , $ tableName )
6566 ->whereNotNull ('REFERENCED_TABLE_NAME ' )
67+ ->orderBy ('ORDINAL_POSITION ' )
6668 ->get ();
6769
6870 $ foreignKeys ->each (function ($ foreignKey ) {
@@ -72,4 +74,4 @@ public function extractForeignKeys(string $tableName): Collection
7274
7375 return $ foreignKeys ;
7476 }
75- }
77+ }
You can’t perform that action at this time.
0 commit comments