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
49
49
return DB ::table ('INFORMATION_SCHEMA.COLUMNS ' )
50
50
->where ('TABLE_SCHEMA ' , config ('database.connections.mysql.database ' ))
51
51
->where ('TABLE_NAME ' , $ tableName )
52
+ ->orderBy ('ORDINAL_POSITION ' )
52
53
->get ();
53
54
}
54
55
@@ -63,6 +64,7 @@ public function extractForeignKeys(string $tableName): Collection
63
64
->where ('TABLE_SCHEMA ' , config ('database.connections.mysql.database ' ))
64
65
->where ('TABLE_NAME ' , $ tableName )
65
66
->whereNotNull ('REFERENCED_TABLE_NAME ' )
67
+ ->orderBy ('ORDINAL_POSITION ' )
66
68
->get ();
67
69
68
70
$ foreignKeys ->each (function ($ foreignKey ) {
@@ -72,4 +74,4 @@ public function extractForeignKeys(string $tableName): Collection
72
74
73
75
return $ foreignKeys ;
74
76
}
75
- }
77
+ }
You can’t perform that action at this time.
0 commit comments