protected function analyzeForeignKeys(&$structure, $table)
{
$lowerTable = strtolower($table);
foreach ($this->connection->getSupplementalDriver()->getForeignKeys($table) as $row) {
$structure['belongsTo'][$lowerTable][$row['local']] = $row['table'];
$structure['hasMany'][strtolower($row['table'])][$table][] = $row['local'];
}
if (isset($structure['belongsTo'][$lowerTable])) {
uksort($structure['belongsTo'][$lowerTable], function ($a, $b) {
return strlen($a) - strlen($b);
});
}
}